MaxwellMayaCamera class

Description

This class allows you to manipulate camera settings in Maxwell. You can create new cameras by using the MaxwellMayaAPI::CreateCamera method.

Note: if you create a new camera and set it as active, its exposure time will not affect the shutter interval for motion blur. That value is determined at the start of the export process, before any callbacks are executed, and cannot be changed later.

Methods

voidDestroy()
voidSetName(const MString& name)
MStringGetName() const
boolSetActive()
boolIsActive() const
boolSetResolution(unsigned int width, unsigned int height)
voidGetResolution(unsigned int& width, unsigned int& height) const
boolSetResolutionWidth(unsigned int width)
unsigned intGetResolutionWidth() const
boolSetResolutionHeight(unsigned int height)
unsigned intGetResolutionHeight() const
boolSetFilmSize(double width, double height)
voidGetFilmSize(double& width, double& height) const
boolSetFilmWidth(double width)
doubleGetFilmWidth() const
boolSetFilmHeight(double height)
doubleGetFilmHeight() const
boolSetPixelAspect(double aspect)
doubleGetPixelAspect() const
boolSetShutterTime(double shutterTime)
doubleGetShutterTime() const
boolSetISO(double iso)
doubleGetISO() const
boolSetFPS(double fps)
doubleGetFPS() const
boolSetDiaphragm(DiaphragmType type, unsigned int numBlades, double angle)
voidGetDiaphragm(DiaphragmType& type, unsigned int& numBlades, double& angle)
boolSetRegion(RegionType type, unsigned int left, unsigned int right, unsigned int top, unsigned int bottom)
voidGetRegion(RegionType& type, unsigned int& left, unsigned int& right, unsigned int& top, unsigned int& bottom) const
boolSetFilmOffset(double horizontalShift, double verticalShift)
voidGetFilmOffset(double& horizontalShift, double& verticalShift) const
boolSetClipDistances(double nearClip, double farClip)
voidGetClipDistances(double& nearClip, double& farClip) const
boolEnableClipping(bool enable)
boolIsClippingEnabled() const
unsigned intGetNumSteps() const
boolSetStep(unsigned int step, const MFloatPoint& position, const MFloatPoint& focusPoint, const MFloatVector& up, double focalLen, double fStop, double timeOffset)
boolGetStep(unsigned int step, MFloatPoint& position, MFloatPoint& focusPoint, MFloatVector& up, double& focalLen, double& fStop, double& timeOffset) const
boolSetStep(unsigned int step, const MPoint& position, const MPoint& focusPoint, const MVector& up, double focalLen, double fStop, double timeOffset)
boolGetStep(unsigned int step, MPoint& position, MPoint& focusPoint, MVector& up, double& focalLen, double& fStop, double& timeOffset) const

void Destroy()

Destroy the camera, removing it from the Maxwell scene.

void SetName(const MString& name)

Set the name of the camera.

MString GetName() const

Returns the name of the camera.

bool SetActive()

Sets the camera as the active (renderable) camera in the scene.

bool IsActive() const

Returns true if this camera is the active (renderable) camera.

bool SetResolution(unsigned int width, unsigned int height)
void GetResolution(unsigned int& width, unsigned int& height) const
bool SetResolutionWidth(unsigned int width)
unsigned int GetResolutionWidth() const
bool SetResolutionHeight(unsigned int height)
unsigned int GetResolutionHeight() const

Set or get the render resolution.

In Python, only SetResolution and GetResolution are defined; GetResolution takes no arguments and returns the values as a 2-tuple.

bool SetFilmSize(double width, double height)
void GetFilmSize(double& width, double& height) const
bool SetFilmWidth(double width)
double GetFilmWidth() const
bool SetFilmHeight(double height)
double GetFilmHeight() const

Set or get the film size in meters.

In Python, only SetFilmSize and GetFilmSize are defined; GetFilmSize takes no arguments and returns the values as a 2-tuple.

bool SetPixelAspect(double aspect)

Sets the pixel aspect ratio.

double GetPixelAspect() const

Returns the pixel aspect ratio.

bool SetShutterTime(double shutterTime)

Sets the exposure time in seconds. As explained in the introduction, changing this value for the renderable camera will not affect the shutter time used for motion blur.

double GetShutterTime() const

Returns the exposure time in seconds.

bool SetISO(double iso)

Sets the ISO film rating (film speed).

double GetISO() const

Returns the ISO film rating.

bool SetFPS(double fps)

Sets the number of frames per second. This value is not used when rendering, it is only needed for display purposes in Maxwell Studio.

double GetFPS() const

Returns the number of frames per second configured for the camera.

bool SetDiaphragm(DiaphragmType type, unsigned int numBlades, double angle)

Set the diaphragm parameters. The type argument can be one of:

  • DiaphragmType_Circular: the diaphragm is a perfect circle and will produce circular bokeh. The numBlades and angle values are ignored.
  • DiaphragmType_Polygonal: simulates a real diaphragm with overlapping blades, producing bokeh in the shape of regular polygons. The numBlades argument controls how many sides the polygons have and the angle argument controls the rotation of the bokeh shapes.

void GetDiaphragm(DiaphragmType& type, unsigned int& numBlades, double& angle)

Returns the diaphragm parameters. The Python version takes no arguments and returns the values in a 3-tuple.

bool SetRegion(RegionType type, unsigned int left, unsigned int right, unsigned int top, unsigned int bottom)

Allows you to render only a region of the frame. The type argument is one of:

  • RegionType_Normal: the region is rendered at its normal resolution and the areas outside the region will be black.
  • RegionType_BlowUp: the region is blown up to cover the whole frame.

The left, right, top and bottom arguments are in pixels and should not exceed the render resolution.

void GetRegion(RegionType& type, unsigned int& left, unsigned int& right, unsigned int& top, unsigned int& bottom) const

Returns the region render parameters. The Python version takes no arguments and returns the values in a 5-tuple.

bool SetFilmOffset(double horizontalShift, double verticalShift)

Used to configure the shift lens feature. The range for the shift values is -100..100.

void GetFilmOffset(double& horizontalShift, double& verticalShift) const

Returns the shift lens parameters. The Python version takes no arguments and returns the values in a 2-tuple.

bool SetClipDistances(double nearClip, double farClip)

Sets the near and far values for Z clipping. This method is replaced by SetClipping in Python, which takes a boolean first argument specifying if the feature is enabled or not.

void GetClipDistances(double& nearClip, double& farClip) const

Returns the near and far values used for Z clipping. This method is replaced by GetClipping in Python, which returns a 3-tuple with the state of the feature and the two distances.

bool EnableClipping(bool enable)

Enable or disable Z clipping. This method does not exist in Python, where GetClipping can be used instead.

bool IsClippingEnabled() const

Returns the state of the Z clipping feature. This method does not exist in Python, where GetClipping can be used instead.

unsigned int GetNumSteps() const

Returns the number of motion steps configured for the camera. This value is set when the camera is created and cannot be changed afterwards. You are not forced to set the same value as that used for object motion, but it is advisable to do so, otherwise differences in the interpolation process between the camera movement and the object movement can produce unwanted effects.

This method does not exist in Python, where GetSteps returns a list of all the steps.

bool SetStep(unsigned int step, const MFloatPoint& position, const MFloatPoint& focusPoint, const MFloatVector& up, double focalLen, double fStop, double timeOffset)
bool SetStep(unsigned int step, const MPoint& position, const MPoint& focusPoint, const MVector& up, double focalLen, double fStop, double timeOffset)

Sets the location, focal length and f/stop for the camera at the given motion step. The timeOffset argument represents the fraction of the shutter time at which the step values apply (0 means shutter open, 1 means shutter close). While it is possible to specify any value for this argument, it is recommended to use step / (GetNumSteps() - 1) so that the steps are equally spaced in time. The exporter uses this formula when writing object motion, so using a different set of step times can result in differences between how the camera movement and the object movement is interpolated. This, in turn, can lead to unwanted effects, such as seeing motion blur on an object which is moving with the camera (and should have no blur).

bool GetStep(unsigned int step, MFloatPoint& position, MFloatPoint& focusPoint, MFloatVector& up, double& focalLen, double& fStop, double& timeOffset) const
bool GetStep(unsigned int step, MPoint& position, MPoint& focusPoint, MVector& up, double& focalLen, double& fStop, double& timeOffset) const

Returns the parameters for the given motion step. This method is replaced by GetSteps in Python, which returns a list of all the step values. The items in the list are 6-tuples with values in the same order and with the same type as the arguments to the C++ methods.