- Main Page
- Related Pages
- Modules
- Classes
- Examples

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | Static Public Member Functions | Protected Member Functions

# MFnRenderLayer Class Reference

# OpenMayaRender - API module for rendering | FunctionSet classes

Search for all occurrences

## Detailed Description

Function set for render layer.

Provide functionalities for working with render layers such as getting the objects present in the render layer or checking whether the given object is in the current layer.

`#include <MFnRenderLayer.h>`

Inheritance diagram for MFnRenderLayer:
[legend]

List of all members.

## Public Member Functions
virtual MFn::Type | type () const
| Function set type.
virtual | ~MFnRenderLayer ()
| Destructor.
| MFnRenderLayer ()
| Default constructor.
| MFnRenderLayer (MObject &object, MStatus *ReturnStatus=NULL)
| Constructor.
bool | inLayer (const MObject &transform, MStatus *ReturnStatus=NULL)
| Returns true if the given shape is in this layer.
MStatus | layerChildren (MObjectArray &children, bool recurse=false)
| Returns the container layers for this layer.
bool | inCurrentRenderLayer (const MDagPath &objectPath, MStatus *ReturnStatus=NULL)
| The function checks if the given object is present in the current render layer or not.
MStatus | listMembers (MObjectArray &objectsInLayer) const
| Returns the objects present in the render layer.
bool | isPlugAdjusted (const MPlug &scenePlug, MStatus *ReturnStatus=NULL) const
| The function checks if the specified plug is adjusted or not; returns true if the plug is adjusted, else returns false.
MPlug | adjustmentPlug (const MPlug &scenePlug, MStatus *ReturnStatus=NULL) const
| Returns the render layer adjustment value plug for the specified plug.
MStatus | externalRenderPasses (MObjectArray &renderPassArray) const
| The function builds an array of unique render pass nodes (MObject) that are connected to the renderPass attribute.
bool | passHasObject (const MObject &renderPass, const MDagPath &objectPath, MStatus *ReturnStatus=NULL) const
| Returns true if the specified object instance contributes to the given render pass, based on the pass contribution maps attached to the layer.
bool | passHasLight (const MObject &renderPass, const MObject &light, MStatus *ReturnStatus=NULL) const
| Returns true if the specified light contributes to the given render pass, based on the pass contribution maps attached to this layer.
| MFnRenderLayer (const MObject &object, MStatus *ReturnStatus=NULL)
| Constructor.
## Static Public Member Functions
static MObject | findLayerByName (const MString &renderLayer, MStatus *ReturnStatus=NULL)
| This function returns an MObject to a render layer that matches the specified name.
static MObject | defaultRenderLayer (MStatus *ReturnStatus=NULL)
| Returns the MObject for the defaultRenderLayer.
static MStatus | listAllRenderLayers (MObjectArray &rl)
| Returns the list of render layers currently in the system.
static MObject | currentLayer (MStatus *ReturnStatus=NULL)
| Returns the MObject for the current render layer.
## Protected Member Functions
virtual const char * | className () const
| Class name.

## Constructor & Destructor Documentation

MFnRenderLayer | ( | MObject & | object,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Constructor.

Class constructor that initializes the function set to the given MObject.

Parameters:

  [in] | object | The MObject to attach the function set to
  [out] | ReturnStatus | the return status

Status Codes:
  - MS::kSuccess if the function set is successfully attached
  - MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

MFnRenderLayer | ( | const MObject & | object,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Constructor.

Class constructor that initializes the function set to the given MObject.

Parameters:

  [in] | object | The MObject to attach the function set to
  [out] | ReturnStatus | the return status

Status Codes:
  - MS::kSuccess if the function set is successfully attached
  - MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

## Member Function Documentation

MFn::Type type | ( |  | ) | const `[virtual]`

Search for all occurrences

Function set type.

Return the class type : MFn::kRenderLayer.

Reimplemented from MFnDependencyNode.

const char * className | ( |  | ) | const `[protected, virtual]`

Search for all occurrences

Class name.

Return the class name : "MFnRenderLayer".

Reimplemented from MFnDependencyNode.

bool inLayer | ( | const MObject & | transform,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Search for all occurrences

Returns true if the given shape is in this layer.

This method will check all container layers for transform containment. The MObject specified must be a shape node.

Parameters:

  [in] | transform | MObject of the shape we are testing against.
  [out] | ReturnStatus | Return code.

Returns:
  True if the given node is in the layer, false otherwise.

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

MStatus layerChildren | ( | MObjectArray & | array,
|  | bool | recurse = `false`
| ) |  |

Search for all occurrences

Returns the container layers for this layer.

Container layers provide the ability for a given render layer to "contain" other render layers.

Parameters:

  [in] | array | List of contained render layers.
  [in] | recurse | If true then the list operation will be applied recursively to any contained render layers which themselves contain other render layers.

Returns:
  Status code

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

bool inCurrentRenderLayer | ( | const MDagPath & | objectPath,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  |

Search for all occurrences

The function checks if the given object is present in the current render layer or not.

Parameters:

  [in] | objectPath | Path of the render layer object.
  [out] | ReturnStatus | Status code.

Returns:
  True if the given object is in the current render layer, false otherwise.

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

MStatus listMembers | ( | MObjectArray & | objectsInLayer | ) | const

Search for all occurrences

Returns the objects present in the render layer.

Parameters:

  [in] | objectsInLayer | The array of MObjects, present in the layer.

Returns:
  Status code

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

bool isPlugAdjusted | ( | const MPlug & | scenePlug,
|  | MStatus * | retStatus = `NULL`
| ) |  | const

Search for all occurrences

The function checks if the specified plug is adjusted or not; returns true if the plug is adjusted, else returns false.

Parameters:

  [in] | scenePlug | The plug which needs to be checked for adjustment.
  [out] | retStatus | MStatus object returning the status.

Returns:
  True if the plug is adjusted, false otherwise.

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

MPlug adjustmentPlug | ( | const MPlug & | scenePlug,
|  | MStatus * | retStatus = `NULL`
| ) |  | const

Search for all occurrences

Returns the render layer adjustment value plug for the specified plug.

If there is no layer override on the plug, a copy of scenePlug is returned.

Parameters:

  [in] | scenePlug | The plug for which the adjustment is sought.
  [out] | retStatus | MStatus object returning the status.

Returns:
  The render layer adjustment plug.

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

MStatus externalRenderPasses | ( | MObjectArray & | renderPassArray | ) | const

Search for all occurrences

The function builds an array of unique render pass nodes (MObject) that are connected to the renderPass attribute.

This function descends recursively into render pass sets to collect all connected render passes.

Parameters:

  [out] | renderPassArray | Array to which the result of the search is written.

Returns:
  Status code

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

bool passHasObject | ( | const MObject & | renderPass,
|  | const MDagPath & | objectInstance,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | const

Search for all occurrences

Returns true if the specified object instance contributes to the given render pass, based on the pass contribution maps attached to the layer.

This method does not verify whether the object instance or the renderPass are actually rendered by the layer.

Parameters:

  [in] | renderPass | a render pass node
  [in] | objectInstance | DAG path of a shape instance
  [out] | ReturnStatus | status of the method call.

Returns:
  True if the object contributes to the pass, false otherwise.

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

bool passHasLight | ( | const MObject & | renderPass,
|  | const MObject & | light,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | const

Search for all occurrences

Returns true if the specified light contributes to the given render pass, based on the pass contribution maps attached to this layer.

This method does not verify whether the light or the renderPass are actually rendered by the layer.

Parameters:

  [in] | renderPass | a render pass node
  [in] | light | a light shape node
  [out] | ReturnStatus | status of the method call.

Returns:
  True if the light contributes to the pass, false otherwise.

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

MObject findLayerByName | ( | const MString & | renderLayer,
|  | MStatus * | ReturnStatus = `NULL`
| ) |  | `[static]`

Search for all occurrences

This function returns an MObject to a render layer that matches the specified name.

If no render layer is found with the given name, MObject::kNullObj is returned.

Parameters:

  [in] | renderLayer | The name of the render layer.
  [out] | ReturnStatus | status of the method call.

Returns:
  The matching render layer or MObject::kNullObj if no matching render layer was found.

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

MObject defaultRenderLayer | ( | MStatus * | ReturnStatus = `NULL` | ) | `[static]`

Search for all occurrences

Returns the MObject for the defaultRenderLayer.

This MObject can be used in MFnRenderLayer.

Parameters:

  [out] | ReturnStatus | status of the method call.

Returns:
  The default render layer.

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

MStatus listAllRenderLayers | ( | MObjectArray & | array | ) | `[static]`

Search for all occurrences

Returns the list of render layers currently in the system.

Parameters:

  [in] | array | MObjectArray of render layers.

Returns:
  Status code

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

MObject currentLayer | ( | MStatus * | ReturnStatus = `NULL` | ) | `[static]`

Search for all occurrences

Returns the MObject for the current render layer.

This MObject can be used in MFnRenderLayer.

Parameters:

  [out] | ReturnStatus | status of the method call.

Returns:
  The current render layer.

Status Codes:
  - MS::kSuccess The method was successful.
  - MS::kFailure An object error has occurred.

MFnRenderLayer MFnRenderLayer MFnRenderLayer MFnRenderLayer MFnRenderLayer MFnRenderLayer MFnRenderLayer MFnRenderLayer MFnRenderLayer MFnRenderLayer
MFnRenderLayer MFnRenderLayer MFnRenderLayer MFnRenderLayer MFnRenderLayer MFnRenderLayer MFnRenderLayer MFnRenderLayer MFnRenderLayer MFnRenderLayer