#include <MDagModifier.h>
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.
Public Member Functions | |
MDagModifier () | |
~MDagModifier () | |
MObject | createNode (const MTypeId &typeId, const MObject &parent=MObject::kNullObj, MStatus *ReturnStatus=NULL) |
MObject | createNode (const MString &type, const MObject &parent=MObject::kNullObj, MStatus *ReturnStatus=NULL) |
MStatus | reparentNode (const MObject &node, const MObject &newParent=MObject::kNullObj) |
MDagModifier::MDagModifier | ( | ) |
The class constructor.
MDagModifier::~MDagModifier | ( | ) |
The class destructor.
MObject MDagModifier::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 MDagModifier::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 MDagModifier::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 |
Autodesk® Maya® 2009 © 1997-2008 Autodesk, Inc. All rights reserved. | Generated with 1.5.6 |