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

- Class List
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Static Public Member Functions | Friends

# MEdit Class Reference
OpenMaya - API module for common classes

This reference page is linked to from the following overview topics: Extension for Autodesk Maya 2013.

Search for all occurrences

## Detailed Description

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.

`#include <MEdit.h>`

Inheritance diagram for MEdit:
[legend]

List of all members.

## 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.
MString | getString (MStatus *ReturnStatus=NULL) const
| Returns the ASCII string related to the current edit.
bool | isApplied (MStatus *ReturnStatus=NULL) const
| Query if we attempted to apply the edit.
bool | isFailed (MStatus *ReturnStatus=NULL) const
| Query if the edit is applied successfully.
bool | isTopLevel (MStatus *ReturnStatus=NULL) const
| Query if the edit was made from the top-level.
MStatus | setApplied (bool isApplied)
| Set whether we attempted to apply this edit.
MStatus | setFailed (bool failed)
| Set if this edit was applied successfully.
bool | hasEditData () const
| Query if the edit has any user-defined editData associated with it.
bool | matches (const MPxEditData *editData) const
| Query if the edit has user-defined editData associated with it that matches the given editData object.
## Static Public Member Functions
static const char * | className ()
| Returns the name of this class.
## Friends
class | MItEdits Search for all occurrences

## Member Enumeration Documentation

enum EditType

Search for all occurrences

Type of edit.

Enumerator:

  kNullEdit | Null edit. Search for all occurrences
  kSetAttrEdit | Edit indicating a change in plug value. Search for all occurrences
  kConnectDisconnectEdit | Edit indicating a connection or disconnection. Search for all occurrences
  kAddRemoveAttrEdit | Edit indicating an attribute added or removed. Search for all occurrences
  kParentEdit | Edit indicating a parenting operation. Search for all occurrences
  kFcurveEdit | Edit indicating an fcurve modification. Search for all occurrences

## Member Function Documentation

MEdit::EditType editType | ( | MStatus * | ReturnStatus = `NULL` | ) | const`[virtual]`

Search for all occurrences

Returns the enum related to the type of the current edit.

Parameters:

  [out] | ReturnStatus | return status

Returns:
  The current reference or assembly edit type or kNullEdit if there is no current edit

Status Codes:
  - MS::kSuccess Operation successful
  - MS::kFailure Edit was not initialized successfully

Reimplemented in MAddRemoveAttrEdit, MConnectDisconnectAttrEdit, MFcurveEdit, MParentingEdit, and MSetAttrEdit.

MString getString | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

Returns the ASCII string related to the current edit.

Parameters:

  [out] | ReturnStatus | return status

Returns:
  The ASCII string related to the current edit

Status Codes:
  - MS::kSuccess Operation successful
  - MS::kFailure Edit was not initialized successfully

bool isApplied | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

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.

Parameters:

  [out] | ReturnStatus | return status

Returns:
  - true We attempted to apply the edit.
  - false We did not attempt to apply the edit yet.

Status Codes:
  - MS::kSuccess Operation successful
  - MS::kFailure Edit was not initialized successfully

bool isFailed | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

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.

Parameters:

  [out] | ReturnStatus | return status

Returns:
  - true The edit was applied successfully.
  - false The edit failed to be applied.

Status Codes:
  - MS::kSuccess Operation successful
  - MS::kFailure Edit was not initialized successfully

bool isTopLevel | ( | MStatus * | ReturnStatus = `NULL` | ) | const

Search for all occurrences

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.

Parameters:

  [out] | ReturnStatus | return status

Returns:
  - true The edit was made from the top-level.
  - false The edit was made in a nested reference/assembly.

Status Codes:
  - MS::kSuccess Operation successful
  - MS::kFailure Edit was not initialized successfully

MStatus setApplied | ( | bool | isApplied | ) |

Search for all occurrences

Set whether we attempted to apply this edit.

Parameters:

  [in] | isApplied | If we attempted to apply this edit.

Returns:
  Status Code

Status Codes:
  - MS::kSuccess Success
  - MS::kFailure Object error

MStatus setFailed | ( | bool | failed | ) |

Search for all occurrences

Set if this edit was applied successfully.

Parameters:

  [in] | failed | Set if this edit was applied successfully.

Returns:
  Status Code

Status Codes:
  - MS::kSuccess Success
  - MS::kFailure Object error

bool hasEditData | ( |  | ) | const

Search for all occurrences

Query if the edit has any user-defined editData associated with it.

See also matches().

Returns:
  - true The edit has associated editData
  - false The edit does not have associated editData

bool matches | ( | const MPxEditData * | editData | ) | const

Search for all occurrences

Query if the edit has user-defined editData associated with it that matches the given editData object.

See also hasEditData().

Parameters:

  [in] | editData | An editData object to compare with this object

Returns:
  - true The edit has matching associated editData
  - false The edit does not have matching associated editData

const char * className | ( |  | ) | `[static]`

Search for all occurrences

Returns the name of this class.

Returns:
  The name of this class.

Reimplemented in MAddRemoveAttrEdit, MConnectDisconnectAttrEdit, MFcurveEdit, MParentingEdit, and MSetAttrEdit.

MEdit MEdit MEdit MEdit MEdit MEdit MEdit MEdit MEdit MEdit
MEdit MEdit MEdit MEdit MEdit MEdit MEdit MEdit MEdit MEdit