zoomCameraCmd/zoomCameraCmd.cpp
#include <maya/MIOStream.h>
#include <maya/MPxCommand.h>
#include <maya/MFnPlugin.h>
#include <maya/MString.h>
#include <maya/MArgList.h>
#include <maya/MFnCamera.h>
#include <maya/MGlobal.h>
#include <maya/M3dView.h>
#include <maya/MDagPath.h>
{
public:
zoomCamera() {};
virtual ~zoomCamera();
static void* creator();
private:
};
zoomCamera::~zoomCamera() {}
void* zoomCamera::creator()
{
return new zoomCamera();
}
{
redoIt();
}
else {
cerr << "Error getting camera" << endl;
}
return stat;
}
{
double fl = fnCamera.focalLength();
fnCamera.setFocalLength( fl * 2.0 );
}
{
double fl = fnCamera.focalLength();
fnCamera.setFocalLength( fl / 2.0 );
}
bool zoomCamera::isUndoable() const
{
return true;
}
{
MFnPlugin plugin( obj, PLUGIN_COMPANY,
"3.0",
"Any");
status = plugin.registerCommand( "zoomCamera", zoomCamera::creator );
if (!status) {
status.
perror(
"registerCommand");
return status;
}
return status;
}
{
status = plugin.deregisterCommand( "zoomCamera" );
if (!status) {
status.
perror(
"deregisterCommand");
return status;
}
return status;
}