Generic Class for Accessing Internal Maya Objects.
Determine if an Object exists.
Determine if an Object is compatible with a specific Function Set.
MObject is the generic class for accessing all Maya internal modelling, animation and rendering Objects, collectively referred to as Model Objects, through the API. This includes all Dependency Graph (DG) Nodes, of which Directed Acyclic Graph (DAG) Nodes are a subset.
Each instance of an MObject represents a specific Node or Attribute on a Node in the DG. Under the C++ class scheme MObjects simply have type MObject with no base or derived hierarchy. However, MObjects may be many different types of Model objects, from Attributes to transforms, including components of geometry such as Control Vertices (CV), faces, edges and vertices. This allows many different types of objects to be moved accessed through the API without undue concern on the part of plug-in developers for the type of object being manipulated.
Since it is impractical to provide every applicable method in MObjects, the methods applicable to Maya Objects are encapsulated in Function Sets. Function Sets can be attached to compatible MObjects to provide an external interface to methods appropriate to that MObject.
The link between an MObject and the role it performs as a Maya Model object, as well as the compatibility between MObjects and Function Sets is managed by the API Run-Time Type Identification (RTTI) system. The two key concepts of this system are the Maya Object type and the Function Set type (both in MFn::Type). All MObjects have one and only one Maya Object type. All Function Sets have one and only one Function Set type. MObjects may, however, be compatible with many types of Function Sets. This compatibility follows the class hierarchy of the Function Sets. Thus an MObject with Maya Object type MFn::kNurbsSurface would be compatible with MFnNurbsSurface, MFnDagNode, MFnDependencyNode, MFnNamedObject and MFnBase.
Use hasFn() to determine if the Object is comaptible with a given Function Set.
Use isNull() to determine if the internal Maya Object exists.
|Class Constructor. More...|
|MObject (const MObject &other)|
|Class Copy Constructor. More...|
|The class destructor. More...|
|bool||hasFn (MFn::Type fs) const|
|Determines the whether or not the internal Object is compatible with the given Function Type. More...|
|bool||isNull () const|
|Determines the whether or not an internal Object exists. More...|
|MFn::Type||apiType () const|
|Determines the exact type of the Maya internal Object. More...|
|const char *||apiTypeStr () const|
|Returns a string that gives the object's type is a readable form. More...|
|bool||operator== (const MObject &) const|
|The comparison operator. More...|
|bool||operator!= (const MObject &) const|
|The inequality operator. More...|
|MObject &||operator= (const MObject &)|
|The assignment operator. More...|
|Null Object for use as default argument. |
The class destructor.
Destroys the current object if nothing refers to it.
Determines the whether or not the internal Object is compatible with the given Function Type.
|[in]||fs||Function Set type|
Determines the whether or not an internal Object exists.
Determines the exact type of the Maya internal Object.
If the object does not exist (is null), returns MFn::kInvalid.
|const char * apiTypeStr||(||)||const|
Returns a string that gives the object's type is a readable form.
This is useful for debugging when type of an object needs to be printed.
If the object does not exist (is null), returns "kInvalid".
|bool operator==||(||const MObject &||other||)||const|
The comparison operator.
Returns true if both MObjects refer to the same Maya object.
|bool operator!=||(||const MObject &||other||)||const|
The inequality operator.
Returns true if the MObjects refer to different Maya objects.
The assignment operator.
Destroys the current object if no other MObjects refer to it. Points this object to the passed in object.