C++ API Reference
|
A class for performing node class-level operations in the dependency graph. More...
#include <MNodeClass.h>
Public Member Functions | |
MNodeClass (const MString &nodeClassName) | |
Construct an MNodeClass object based on the given class name. More... | |
MNodeClass (const MTypeId &nodeTypeId) | |
Construct an MNodeClass object based on the given MTypeId. More... | |
MTypeId | typeId () const |
Returns the type id of this node class. More... | |
MString | typeName () const |
Returns the type name of this node class. More... | |
MString | classification () const |
Retrieves the classification string for a node class. More... | |
MStatus | addToClassification (const MString &str) |
Adds to the node class's classification string. More... | |
MStatus | removeFromClassification (const MString &str) |
Removes an element from the node class's classification string. More... | |
MString | pluginName (MStatus *ReturnStatus=NULL) const |
Returns the name of the plug-in this node class was defined in. More... | |
MStatus | addExtensionAttribute (const MObject &attr) const |
Adds an extension attribute to the node class. More... | |
MStatus | removeExtensionAttribute (const MObject &attr) const |
Removes an extension attribute from the node class. More... | |
MStatus | removeExtensionAttributeIfUnset (const MObject &attr) const |
Removes an extension attribute from the given dependency node type but only if there are no nodes in the graph with non-default values for this attribute. More... | |
MStatus | getAttributes (MObjectArray &attr) const |
Get the list of attributes for the node class. More... | |
unsigned int | attributeCount (MStatus *ReturnStatus=NULL) const |
Get the number of attributes for the node class. More... | |
MObject | attribute (unsigned int index, MStatus *ReturnStatus=NULL) const |
Finds the attribute of this node class at the given index. More... | |
MObject | attribute (const MString &attrName, MStatus *ReturnStatus=NULL) const |
Finds the attribute of this node class that has the given name. More... | |
bool | hasAttribute (const MString &attrName, MStatus *ReturnStatus=NULL) const |
Returns true if the node class already has an attribute with the given name. More... | |
Static Public Member Functions | |
static const char * | className () |
Returns the name of this class. More... | |
A class for performing node class-level operations in the dependency graph.
MNodeClass allows the manipulation of dependency graph node classes. Operations specific to a particular node should instead use MFnDependencyNode.
MNodeClass | ( | const MString & | nodeClassName | ) |
Construct an MNodeClass object based on the given class name.
If the name cannot be resolved as a known class, the MNodeClass will refer to an MFn::kInvalid api type.
[in] | nodeClassName | class name of the node type to wrap |
OPENMAYA_MAJOR_NAMESPACE_OPEN MNodeClass | ( | const MTypeId & | nodeTypeId | ) |
Construct an MNodeClass object based on the given MTypeId.
This can then be used to perform class-level operations.
[in] | nodeTypeId | id of the node type to wrap |
MTypeId typeId | ( | ) | const |
Returns the type id of this node class.
The type is is the 4 byte code that is used in the binary file format to identify the type of this node.
MString typeName | ( | ) | const |
Returns the type name of this node class.
The string returned is the name of the node type as it is used in the ascii file format.
MString classification | ( | ) | const |
Retrieves the classification string for a node class.
This is a string that is used in dependency nodes that are also shaders to provide more detailed type information to the rendering system. See the documentation for the MEL commands getClassification and listNodeTypes for information on the strings that can be provided.
User-defined nodes set this value through a parameter to MFnPlugin::registerNode.
Adds to the node class's classification string.
See the classification() method, above.
Adding to the classification string is useful in conjunction with the MSwatchRenderRegister API, to override the swatch rendering of built-in Maya node types. Adding the classification 'swatch/File' causes nodes to use a simple default icon instead of their usual swatch rendering.
[in] | str | The string to add to the classification |
Removes an element from the node class's classification string.
See the classification() method, above.
[in] | str | The string to remove from the classification |
Returns the name of the plug-in this node class was defined in.
The name returned is the name of the plug-in on disk, and may contain pathname separators (such as `/') and drive letters (e.g. C:).
[out] | ReturnStatus | return status |
Adds an extension attribute to the node class.
An extension attribute is a class-level attribute which has been added dynamically to a node class. Because it is added at the class level, all nodes of that class will have the given attribute, and will only store the attribute's value if it differs from the default.
[in] | attr | The attribute to add |
Removes an extension attribute from the node class.
An extension attribute is a class-level attribute which has been added dynamically to a node class. Because it is added at the class level, all nodes of that class will have the given attribute, and will only store the attribute's value if it differs from the default.
[in] | attr | The attribute to remove |
Removes an extension attribute from the given dependency node type but only if there are no nodes in the graph with non-default values for this attribute.
An extension attribute is a class-level attribute which has been added dynamically to a node class. Because it is added at the class level, all nodes of that class will have the given attribute. This method will only remove the attribute if any of its node values differs from the default.
[in] | attr | The attribute to remove |
MStatus getAttributes | ( | MObjectArray & | attr | ) | const |
Get the list of attributes for the node class.
[out] | attr | The list of attributes |
unsigned int attributeCount | ( | MStatus * | ReturnStatus = NULL | ) | const |
Get the number of attributes for the node class.
[out] | ReturnStatus | return status |
Finds the attribute of this node class at the given index.
Index order is based on the order in which the attributes were added to the class.
[in] | index | the index of the attribute |
[out] | ReturnStatus | return status |
Finds the attribute of this node class that has the given name.
[in] | attrName | name of the attribute to find |
[out] | ReturnStatus | return status |
Returns true if the node class already has an attribute with the given name.
[in] | attrName | Name of attribute to be checked. |
[out] | ReturnStatus | return status |
|
static |
Returns the name of this class.