#include <MEdit.h>
Base class for representing information about edits.
MEdit serves as the base class for representing information about edits that are made to certain types of entities, specifically references and assemblies. An edit is any operation that modifies a member of the entity. Examples of such modifications include changing attribute values, connections, parenting and so on.
In the case of references, edits are the changes that occur to referenced nodes.
In the case of assemblies, edits are the changes that occur to assembly members.
Derived classes implement specific types of edits, allowing them to be queried depending on the type of operation.
Public Types | |
enum | EditType { kNullEdit, kSetAttrEdit, kConnectDisconnectEdit, kAddRemoveAttrEdit, kParentEdit, kFcurveEdit } |
Type of edit. More... | |
Public Member Functions | |
virtual EditType | editType (MStatus *ReturnStatus=NULL) const |
Returns the enum related to the type of the current edit. More... | |
MString | getString (MStatus *ReturnStatus=NULL) const |
Returns the ASCII string related to the current edit. More... | |
bool | isApplied (MStatus *ReturnStatus=NULL) const |
Query if we attempted to apply the edit. More... | |
bool | isFailed (MStatus *ReturnStatus=NULL) const |
Query if the edit is applied successfully. More... | |
bool | isTopLevel (MStatus *ReturnStatus=NULL) const |
Query if the edit was made from the top-level. More... | |
MStatus | setApplied (bool isApplied) |
This method is obsolete. More... | |
MStatus | setFailed (bool failed) |
This method is obsolete. More... | |
bool | hasEditData () const |
Query if the edit has any user-defined editData associated with it. More... | |
bool | matches (const MPxEditData *editData) const |
Query if the edit has user-defined editData associated with it that matches the given editData object. More... | |
Static Public Member Functions | |
static const char * | className () |
Returns the name of this class. More... | |
Friends | |
class | MItEdits |
enum EditType |
Type of edit.
|
virtual |
Returns the enum related to the type of the current edit.
[out] | ReturnStatus | return status |
Reimplemented in MConnectDisconnectAttrEdit, MAddRemoveAttrEdit, MParentingEdit, MSetAttrEdit, and MFcurveEdit.
Returns the ASCII string related to the current edit.
[out] | ReturnStatus | return status |
bool isApplied | ( | MStatus * | ReturnStatus = NULL | ) | const |
Query if we attempted to apply the edit.
For example, as far as assemblies are concerned, edits are unapplied if you switch to a representation that can't accept edits, like the cache rep. As for references, edits are unapplied if references are unloaded.
It does not mean the edit was applied successfully. To query success/failure, please use MEdit::isFailed.
[out] | ReturnStatus | return status |
bool isFailed | ( | MStatus * | ReturnStatus = NULL | ) | const |
Query if the edit is applied successfully.
One common cause of failed edit is it cannot find the node to apply the edit. They could be caused by the node name change or the node is not in the scene at the moment.
[out] | ReturnStatus | return status |
bool isTopLevel | ( | MStatus * | ReturnStatus = NULL | ) | const |
Query if the edit was made from the top-level.
Edits that were made from the top-level can be removed. But edits that were made in nested references/assemblies cannot be removed since they are part of another file.
[out] | ReturnStatus | return status |
MStatus setApplied | ( | bool | isApplied | ) |
This method is obsolete.
[in] | isApplied | Not used. |
MStatus setFailed | ( | bool | failed | ) |
This method is obsolete.
[in] | failed | Not used. |
bool hasEditData | ( | ) | const |
Query if the edit has any user-defined editData associated with it.
See also matches().
bool matches | ( | const MPxEditData * | editData | ) | const |
Query if the edit has user-defined editData associated with it that matches the given editData object.
See also hasEditData().
[in] | editData | An editData object to compare with this object |
|
static |
Returns the name of this class.