#include <MCommonRenderSettingsData.h>
Data container for common rendering settings.
This class is a container that encapsulates the data for common rendering globals. The data is intended to be accessed using the following method:
Public Types | |
enum | MpathType { kRelativePath, kFullPathImage, kFullPathTmp } |
Defines the types file paths. More... | |
Public Member Functions | |
MCommonRenderSettingsData () | |
Default contructor. More... | |
~MCommonRenderSettingsData () | |
Destructor. More... | |
bool | isAnimated () const |
Determines if there is animation. More... | |
bool | isMovieFormat () const |
Determines if the output format is a single movie file. More... | |
void | setPassName (const MString &pass) |
Used with getImageName. Sets the pass name for later use. More... | |
void | setFieldName (const MString &field) |
Used with getImageName. Sets the field name for later use. More... | |
const MString | getImageName (MpathType pathType, double frameNumber, const MString &sceneName, const MString &cameraName, const MString &fileFormat, const MObject layer, const bool createDirectory=true, MStatus *ReturnStatus=NULL) const |
Obtains the image name with the proper subdirectory structure. More... | |
const MString | getImageName (MpathType pathType, double frameNumber, const MString &sceneName, const MString &cameraName, const MString &fileFormat, const MObject layer, const MString &customTokenString, const bool createDirectory=true, MStatus *ReturnStatus=NULL) const |
Obtains the image name with the proper subdirectory structure (supports custom tokens). More... | |
bool | shouldRenderFrameAtTime (MpathType pathType, double frameNumber, const MString &sceneName, const MString &cameraName, const MString &fileFormat, const MObject layer, const MString &customTokenString) const |
Indicates whether render the frame or not. If true, render it. If false, skip it. More... | |
const MString | getBufferName (const MObject &renderPass, const MObject &layer, const MString &cameraName, const MString &customTokenString="", const bool leaveUnmatchedTokens=false, MStatus *ReturnStatus=NULL) const |
Get image buffer name. More... | |
Static Public Member Functions | |
static MString | getPreRenderFrameCmd () |
Return the preRenderFrame MEL command, which is run immediately before rendering a frame. More... | |
static MString | getPostRenderFrameCmd () |
Return the postRenderFrame MEL command, which is run immediately after rendering a frame. More... | |
static const char * | className () |
Returns the name of this class. More... | |
Public Attributes | |
MString | name |
Base name for the rendered image. | |
unsigned int | namingScheme |
File naming scheme. | |
unsigned int | framePadding |
Number of padding zeros for the frame number. | |
MString | namePattern |
Single string that defines the whole naming convention. | |
unsigned int | imageFormat |
Predefined supported image format. | |
MString | customImageFormat |
Custom image format name. | |
MTime | frameStart |
First frame number. | |
MTime | frameEnd |
Last frame number. | |
float | frameBy |
Frame number step. | |
bool | skipExistingFrames |
When true, skip existing frames. | |
bool | renderAll |
When false, only the selected objects should be rendered. | |
bool | useCustomExt |
When true, overrides the default image format extension. | |
MString | customExt |
Custom format extension, when useCustomExt is true. | |
bool | renumberFrames |
When true, images need to be renumbered. More... | |
float | renumberStart |
First image number, when renumbering. | |
float | renumberBy |
Image number step, when renumbering. | |
unsigned int | width |
Image width in pixels. | |
unsigned int | height |
Image height in pixels. | |
float | deviceAspectRatio |
Image aspect ratio. This is equal to pixelAspect * width / height. | |
float | pixelAspectRatio |
Pixel aspect ratio. | |
float | dotPerInch |
Dot per Inch. | |
bool | enableDefaultLight |
When on, a default light should be created when no light is available in the scene. | |
MString | preMel |
The mel string to be executed before a scene is rendered. | |
MString | postMel |
The mel string to be executed after a scene is rendered. | |
MString | preRenderLayerMel |
The mel string to be executed before a render layer is rendered. | |
MString | postRenderLayerMel |
The mel string to be executed after a render layer is rendered. | |
MString | preRenderMel |
The mel string to be executed before a frame is rendered. | |
MString | postRenderMel |
The mel string to be executed after a frame is rendered. | |
Friends | |
class | MRenderUtil |
enum MpathType |
OPENMAYA_MAJOR_NAMESPACE_OPEN MCommonRenderSettingsData | ( | ) |
Default contructor.
Initializes an empty object.
Destructor.
Deallocates the memory.
bool isAnimated | ( | ) | const |
Determines if there is animation.
bool isMovieFormat | ( | ) | const |
Determines if the output format is a single movie file.
void setPassName | ( | const MString & | pass | ) |
Used with getImageName. Sets the pass name for later use.
Adds a pass subdirectory to the path for the image.
[in] | pass | The name of the field. |
void setFieldName | ( | const MString & | field | ) |
Used with getImageName. Sets the field name for later use.
Adds a field subdirectory to the path for the image.
[in] | field | The name of the field. |
const MString getImageName | ( | MpathType | pathType, |
double | frameNumber, | ||
const MString & | sceneName, | ||
const MString & | cameraName, | ||
const MString & | fileFormat, | ||
const MObject | layer, | ||
const bool | createDirectory = true , |
||
MStatus * | ReturnStatus = NULL |
||
) | const |
Obtains the image name with the proper subdirectory structure.
Compute the path for the image.
The path type returned depends on which option has been specified by pathType:
[in] | pathType | decides file path format of the returned string. See above. |
[in] | frameNumber | the frame number to be used. |
[in] | sceneName | the scene name. |
[in] | cameraName | the name of the camera rendering this image. |
[in] | fileFormat | if not an empty string, use this file format instead of the one selected in the render settings to decide the final file name. |
[in] | layer | render layer object from which this image is rendered. |
[in] | createDirectory | if true, the image path directory will be created. |
[out] | ReturnStatus | Status code |
const MString getImageName | ( | MpathType | pathType, |
double | frameNumber, | ||
const MString & | sceneName, | ||
const MString & | cameraName, | ||
const MString & | fileFormat, | ||
const MObject | layer, | ||
const MString & | customTokenString, | ||
const bool | createDirectory = true , |
||
MStatus * | ReturnStatus = NULL |
||
) | const |
Obtains the image name with the proper subdirectory structure (supports custom tokens).
Compute the path for the image.
The path type returned depends on which option has been specified by pathType:
[in] | pathType | decides file path format of the returned string. See above. |
[in] | frameNumber | the frame number to be used. |
[in] | sceneName | the scene name. |
[in] | cameraName | the name of the camera rendering this image. |
[in] | fileFormat | if not an empty string, use this file format instead of the one selected in the render settings to decide the final file name. |
[in] | layer | render layer object from which this image is rendered. |
[in] | customTokenString | space separated list of key-value pairs to replace in the image name (ex. "myToken1=myValue1 myToken2=myValue2") |
[in] | createDirectory | if true, the image path directory will be created. |
[out] | ReturnStatus | Status code |
bool shouldRenderFrameAtTime | ( | MpathType | pathType, |
double | frameNumber, | ||
const MString & | sceneName, | ||
const MString & | cameraName, | ||
const MString & | fileFormat, | ||
const MObject | layer, | ||
const MString & | customTokenString | ||
) | const |
Indicates whether render the frame or not. If true, render it. If false, skip it.
Determine whether to render the frame or not by comparing image file name.
If file already exists, skip rendering it. If not, render the frame.
[in] | pathType | decides file path format of the returned string. See above. |
[in] | frameNumber | the frame number to be used. |
[in] | sceneName | the scene name. |
[in] | cameraName | the name of the camera rendering this image. |
[in] | fileFormat | if not an empty string, use this file format instead of the one selected in the render settings to decide the final file name. |
[in] | layer | render layer object from which this image is rendered. |
[in] | customTokenString | space separated list of key-value pairs to replace in the image name (ex. "myToken1=myValue1 myToken2=myValue2") |
const MString getBufferName | ( | const MObject & | renderPass, |
const MObject & | layer, | ||
const MString & | cameraName, | ||
const MString & | customTokenString = "" , |
||
const bool | leaveUnmatchedTokens = false , |
||
MStatus * | ReturnStatus = NULL |
||
) | const |
Get image buffer name.
This name will be used when multiple buffers are rendered into the same image. This is only valid for image formats which support multiple buffers, such as OpenEXR.
[in] | renderPass | Render pass object of the this rendering image. |
[in] | layer | render layer object pointer from which this image is rendered. |
[in] | cameraName | The name of the camera rendering this image. |
[in] | customTokenString | Space separated list of key-value pairs to replace in the buffer name (ex. "myToken1=myValue1 myToken2=myValue2"). |
[in] | leaveUnmatchedTokens | whether to leave the unmatched tokens. |
[out] | ReturnStatus | Status code. |
|
static |
Return the preRenderFrame MEL command, which is run immediately before rendering a frame.
It is run before the configurable preRenderMel string. This command is guaranteed to be a non-empty string.
|
static |
Return the postRenderFrame MEL command, which is run immediately after rendering a frame.
It is run after the configurable postRenderMel string. This command is guaranteed to be a non-empty string.
|
static |
Returns the name of this class.
bool renumberFrames |
When true, images need to be renumbered.
This only affects the image names.