Public Member Functions | Static Public Member Functions

MNodeClass Class Reference

Search for all occurrences

Detailed Description

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.

#include <MNodeClass.h>

List of all members.

Public Member Functions

  MNodeClass (const MString &nodeClassName)
  Construct an MNodeClass object based on the given class name.
  MNodeClass (const MTypeId &nodeTypeId)
  Construct an MNodeClass object based on the given MTypeId.
MTypeId  typeId () const
  Returns the type id of this node class.
MString  typeName () const
  Returns the type name of this node class.
MString  classification () const
  Retrieves the classification string for a node class.
MString  pluginName (MStatus *ReturnStatus=NULL) const
  Returns the name of the plug-in this node class was defined in.
MStatus  addExtensionAttribute (const MObject &attr) const
  Adds an extension attribute to the node class.
MStatus  removeExtensionAttribute (const MObject &attr) const
  Removes an extension attribute from the node class.
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.
MStatus  getAttributes (MObjectArray &attr) const
  Get the list of attributes for the node class.
unsigned int  attributeCount (MStatus *ReturnStatus=NULL) const
  Get the number of attributes for the node class.
MObject  attribute (unsigned int index, MStatus *ReturnStatus=NULL) const
  Finds the attribute of this node class at the given index.
MObject  attribute (const MString &attrName, MStatus *ReturnStatus=NULL) const
  Finds the attribute of this node class that has the given name.
bool  hasAttribute (const MString &attrName, MStatus *ReturnStatus=NULL) const
  Returns true if the node class already has an attribute with the given name.

Static Public Member Functions

static const char *  className ()
  Returns the name of this class.

Constructor & Destructor Documentation

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.

Parameters:
[in] nodeClassName class name of the node type to wrap
MNodeClass ( const MTypeId nodeTypeId )

Construct an MNodeClass object based on the given MTypeId.

This can then be used to perform class-level operations.

Parameters:
[in] nodeTypeId id of the node type to wrap

Member Function Documentation

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.

Returns:
The type id 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.

Returns:
The type name of this node
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.

Returns:
The classification string. If the node class does not have an associated classification, an empty string will be returned.
MString pluginName ( MStatus ReturnStatus = NULL ) const

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:).

Parameters:
[out] ReturnStatus return status
Returns:
The name of the plug-in
Status Codes:
MStatus addExtensionAttribute ( const MObject attr ) const

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.

Parameters:
[in] attr The attribute to add
Returns:
Status of operation.
Status Codes:
MStatus removeExtensionAttribute ( const MObject attr ) const

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.

Parameters:
[in] attr The attribute to remove
Returns:
Status of operation.
Status Codes:
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.

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.

Parameters:
[in] attr The attribute to remove
Returns:
Status of operation.
Status Codes:
MStatus getAttributes ( MObjectArray attr ) const

Get the list of attributes for the node class.

Parameters:
[out] attr The list of attributes
Returns:
Status of operatation
Status Codes:
unsigned int attributeCount ( MStatus ReturnStatus = NULL ) const

Get the number of attributes for the node class.

Parameters:
[out] ReturnStatus return status
Returns:
The number of attributes.
Status Codes:
MObject attribute ( unsigned int  index,
MStatus ReturnStatus = NULL 
) const

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.

Parameters:
[in] index the index of the attribute
[out] ReturnStatus return status
Returns:
The attribute, or kNullObj if no attribute existed at the given index
Status Codes:
MObject attribute ( const MString attrName,
MStatus ReturnStatus = NULL 
) const

Finds the attribute of this node class that has the given name.

Parameters:
[in] attrName name of the attribute to find
[out] ReturnStatus return status
Returns:
The attribute, or kNullObj if no attribute with the given name could be found
Status Codes:
bool hasAttribute ( const MString attrName,
MStatus ReturnStatus = NULL 
) const

Returns true if the node class already has an attribute with the given name.

Parameters:
[in] attrName Name of attribute to be checked.
[out] ReturnStatus return status
Returns:
true if the node class has attribute, false otherwise.
Status Codes:
const char * className ( ) [static]

Returns the name of this class.

Returns:
Name of this class.

MNodeClass MNodeClass MNodeClass MNodeClass MNodeClass MNodeClass MNodeClass MNodeClass MNodeClass MNodeClass
MNodeClass MNodeClass MNodeClass MNodeClass MNodeClass MNodeClass MNodeClass MNodeClass MNodeClass MNodeClass