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

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Protected Member Functions

# MFnContainerNode Class Reference

# OpenMaya - API module for common classes | FunctionSet classes

Search for all occurrences

## Detailed Description

container function set

MFnContainerNode is the function set for creating, querying and editing containers.

Maya uses container nodes to bundle sets of related nodes together with a published attribute list that defines the primary interface to those nodes. This class allows you to query information about container nodes in the Maya scene.

`#include <MFnContainerNode.h>`

Inheritance diagram for MFnContainerNode:
[legend]

List of all members.

## Public Types
enum | MPublishNodeType { kParentAnchor, kChildAnchor, kGeneric }
| Specify which type of published node. More...
## Public Member Functions
virtual MFn::Type | type () const
| Function set type.
virtual | ~MFnContainerNode ()
| Destructor.
| MFnContainerNode ()
| Default constructor.
| MFnContainerNode (MObject &object, MStatus *ReturnStatus=NULL)
| Constructor.
MStatus | getPublishedPlugs (MPlugArray &publishedPlugs, MStringArray &publishedNames) const
| Return two arrays: the first contains the plugs that have been published on this container.
MStatus | getPublishedNames (MStringArray &publishedNames, bool unboundOnly) const
| Return a list of published names on the container.
MStatus | getMembers (MObjectArray &members) const
| Return an array of the nodes included in this container.
MStatus | getSubcontainers (MObjectArray &members) const
| Return an array of the container nodes included in this container.
MStatus | getParentContainer (MObject &parent) const
| Return the parent container, if there is one.
MStatus | getRootTransform (MObject &root) const
| Return the root transform, if there is one.
MStatus | getPublishedNodes (MPublishNodeType type, MStringArray &publishedNames, MObjectArray &nodes) const
| Return a list of the published nodes of a given type.
| MFnContainerNode (const MObject &object, MStatus *ReturnStatus=NULL)
| Constructor.
## Protected Member Functions
virtual const char * | className () const
| Class name.

## Member Enumeration Documentation

enum MPublishNodeType

Search for all occurrences

Specify which type of published node.

Enumerator:

  kParentAnchor | published as parent anchor Search for all occurrences
  kChildAnchor | published as child anchor Search for all occurrences
  kGeneric | published as node (non-anchor) Search for all occurrences

## Constructor & Destructor Documentation

MFnContainerNode | ( | 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

MFnContainerNode | ( | 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::kContainerBase.

Reimplemented from MFnDependencyNode.

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

Search for all occurrences

Class name.

Return the class name : "MFnContainerNode".

Reimplemented from MFnDependencyNode.

MStatus getPublishedPlugs | ( | MPlugArray & | publishedPlugs,
|  | MStringArray & | publishedNames
| ) |  | const

Search for all occurrences

Return two arrays: the first contains the plugs that have been published on this container.

The second contains that published names for those plugs. There is a one-to-one correspondence between the plugs in the first array and the strings in the second.

Parameters:

  [out] | publishedPlugs | array to store the result plugs
  [out] | publishedNames | array to store the result names

Returns:
  Return status

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure this function set does not have a valid container object

MStatus getPublishedNames | ( | MStringArray & | publishedNames,
|  | bool | unboundOnly
| ) |  | const

Search for all occurrences

Return a list of published names on the container.

Depending on the arguments, either all published names or only unbound published names will be returned.

Parameters:

  [out] | publishedNames | array to store the result names
  [in] | unboundOnly | if true, only return names that are not associated with a plug

Returns:
  Return status

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure this function set does not have a valid container object

MStatus getMembers | ( | MObjectArray & | members | ) | const

Search for all occurrences

Return an array of the nodes included in this container.

Parameters:

  [in] | members | array to store the result nodes

Returns:
  Return status

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure this function set does not have a valid container object

MStatus getSubcontainers | ( | MObjectArray & | subcontainers | ) | const

Search for all occurrences

Return an array of the container nodes included in this container.

Parameters:

  [out] | subcontainers | array to store the result nodes

Returns:
  Return status

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure this function set does not have a valid container object

MStatus getParentContainer | ( | MObject & | parent | ) | const

Search for all occurrences

Return the parent container, if there is one.

Otherwise return an empty MObject

Parameters:

  [out] | parent | parent container, if found

Returns:
  Return status

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure this function set does not have a valid container object

MStatus getRootTransform | ( | MObject & | root | ) | const

Search for all occurrences

Return the root transform, if there is one.

Otherwise return an empty MObject.

Parameters:

  [out] | root | root transform, if found

Returns:
  Return status

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure this function set does not have a valid container object

MStatus getPublishedNodes | ( | MPublishNodeType | type,
|  | MStringArray & | publishedNames,
|  | MObjectArray & | nodes
| ) |  | const

Search for all occurrences

Return a list of the published nodes of a given type.

For any names that have assigned nodes, return the node at the corresponding array index. For any names that do not have assigned nodes, a NULL MObject will be at the corresponding array index.

Parameters:

  [in] | type | published node type of interest
  [out] | publishedNames | published names of the specified type
  [out] | nodes | corresponding published node or a NULL MObject

Returns:
  Return status

Status Codes:
  - MS::kSuccess operation successful
  - MS::kFailure this function set does not have a valid container object

MFnContainerNode MFnContainerNode MFnContainerNode MFnContainerNode MFnContainerNode MFnContainerNode MFnContainerNode MFnContainerNode MFnContainerNode MFnContainerNode
MFnContainerNode MFnContainerNode MFnContainerNode MFnContainerNode MFnContainerNode MFnContainerNode MFnContainerNode MFnContainerNode MFnContainerNode MFnContainerNode