Dependency graph modifier.
An MDagModifier is used to change the structure of the DAG. This includes adding nodes, making new connections, and removing existing connections. To perform operations using an MDagModifier, register all of the changes that are to be made and then call the doIt method to make the changes. Undo is provided through the undoIt method.
#include <MDagModifier.h>
Public Member Functions |
|
MDagModifier () | |
The class constructor. |
|
~MDagModifier () | |
The class destructor. |
|
MObject | createNode (const MTypeId &typeId, const MObject &parent=MObject::kNullObj, MStatus *ReturnStatus=NULL) |
This method adds an operation to this DAG
modifier that will add a new node of the given type to the DAG.
|
|
MObject | createNode (const MString &type, const MObject &parent=MObject::kNullObj, MStatus *ReturnStatus=NULL) |
This method adds an operation to this DAG
modifier that will add a new node of the given type to the DAG.
|
|
MStatus | reparentNode (const MObject &node, const MObject &newParent=MObject::kNullObj) |
This method adds an operation to this DAG
modifier that will reparent a node in the DAG. |
|
Static Public Member Functions |
|
static const char * | className () |
Returns the name of this class. |
MObject createNode | ( | const MTypeId & | typeId, |
const MObject & | parent = MObject::kNullObj , |
||
MStatus * | ReturnStatus =
NULL |
||
) |
This method adds an operation to this DAG modifier that will add a new node of the given type to the DAG.
This method may not be used to construct new dependency graph nodes that are not in the DAG. Use MDGModifier for that purpose.
When createNode is called, the new node is created and the MObject handle for it is returned. It should be noted that the node will not be added to the DAG until the doIt method is called.
It is legal to pass in a null object as the parent. When this occurs, the new object gets parented under the world node.
Note that nodes cannot exist in the DAG unless they are under a transform. This method will automatically create a transform if one is required. If a transform is created, then the MObject for the transform will be returned instead of the one for the node.
If a node is created with this method, but the operation is undone, then the MDagModifier will take responsibility for freeing the node. This will be done when the MDagModifier is destructed.
[in] | typeId | type of the node to create |
[in] | parent | parent object in the DAG |
[out] | ReturnStatus | return status |
MObject createNode | ( | const MString & | type, |
const MObject & | parent = MObject::kNullObj , |
||
MStatus * | ReturnStatus =
NULL |
||
) |
This method adds an operation to this DAG modifier that will add a new node of the given type to the DAG.
This method may not be used to construct new dependency graph nodes that are not in the DAG. Use MDGModifier for that purpose.
When createNode is called, the new node is created and the MObject handle for it is returned. It should be noted that the node will not be added to the DAG until the doIt method is called.
It is legal to pass in a null object as the parent. When this occurs, the new object gets parented under the world node.
Note that nodes cannot exist in the DAG unless they are under a transform. This method will automatically create a transform if one is required. If a transform is created, then the MObject for the transform will be returned instead of the one for the node.
If a node is created with this method, but the operation is undone, then the MDagModifier will take responsibility for freeing the This will be done when the MDagModifier is destructed.
[in] | type | type of the node to create |
[in] | parent | parent object in the DAG |
[out] | ReturnStatus | return status |
MStatus reparentNode | ( | const MObject & | node, |
const MObject & | newParent = MObject::kNullObj |
||
) |
This method adds an operation to this DAG modifier that will reparent a node in the DAG.
If the parent passed in is NULL, then the node will be reparented under the world.
[in] | node | node to reparent |
[out] | newParent | new parent for the node |
const char * className | ( | ) | [static] |