class MFnDependencyNode

Jump to documentation

: public MFnBase Dependency node function set. (OpenMaya) (OpenMaya.py)

Inheritance:

MFnDependencyNode < MFnBase

public members:

MFnDependencyNode ()
MFnDependencyNode ( MObject & object, MStatus * ReturnStatus = NULL )
virtual ~MFnDependencyNode ()
virtual MFn::Type type () const
enum MAttrClass
kGlobalDynamicAttr
kLocalDynamicAttr
MObject create ( const MTypeId & typeId , MStatus * ReturnStatus = NULL )
MObject create ( const MTypeId & typeId , const MString & name , MStatus * ReturnStatus = NULL )
MObject create ( const MString & type , MStatus * ReturnStatus = NULL )
MObject create ( const MString & type , const MString & name , MStatus * ReturnStatus = NULL )
MTypeId typeId ( MStatus * ReturnStatus = NULL ) const
MString typeName ( MStatus * ReturnStatus = NULL ) const
MString name ( MStatus * ReturnStatus = NULL ) const
MString setName ( const MString & name , MStatus * ReturnStatus = NULL )
MStatus getConnections ( MPlugArray & array ) const
unsigned int attributeCount ( MStatus * ReturnStatus=NULL) const
MObject attribute ( unsigned int index, MStatus * ReturnStatus=NULL) const
MObject reorderedAttribute ( unsigned int index, MStatus * ReturnStatus=NULL) const
MObject attribute ( const MString & attrName, MStatus * ReturnStatus=NULL) const
MAttrClass attributeClass ( const MObject & attr, MStatus * ReturnStatus=NULL) const
MStatus getAffectedAttributes ( const MObject & attr, MObjectArray & affectedAttributes ) const
MStatus getAffectedByAttributes ( const MObject & attr, MObjectArray & affectedByAttributes ) const
MPlug findPlug ( const MObject & attr, bool wantNetworkedPlug, MStatus * ReturnStatus=NULL) const
MPlug findPlug ( const MString & attrName, bool wantNetworkedPlug, MStatus * ReturnStatus=NULL) const
MPlug findPlug ( const MObject & attr, MStatus * ReturnStatus=NULL) const
MPlug findPlug ( const MString & attrName, MStatus * ReturnStatus=NULL) const
MStatus addAttribute ( const MObject & attr, MAttrClass type = kLocalDynamicAttr )
MStatus removeAttribute ( const MObject & attr, MAttrClass type = kLocalDynamicAttr )
MPxNode * userNode ( MStatus * ReturnStatus=NULL ) const
bool isFromReferencedFile ( MStatus * ReturnStatus=NULL) const
bool isShared ( MStatus * ReturnStatus=NULL) const
bool hasUniqueName ( MStatus * ReturnStatus=NULL) const
MString parentNamespace ( MStatus * ReturnStatus=NULL) const
bool isLocked ( MStatus * ReturnStatus=NULL) const
MStatus setLocked ( bool locked )
static MString classification ( const MString & nodeTypeName )
bool isNewAttribute ( const MObject & attr, MStatus * ReturnStatus=NULL) const
static unsigned int allocateFlag ( const MString pluginName, MStatus * ReturnStatus=NULL )
static MStatus deallocateFlag (const MString pluginName, unsigned int flag)
static MStatus deallocateAllFlags (const MString pluginName)
MStatus setFlag (unsigned int flag, bool state)
bool isFlagSet (unsigned int flag, MStatus * ReturnStatus=NULL) const
bool isDefaultNode ( MStatus * ReturnStatus=NULL) const
MStatus setDoNotWrite ( bool flag )
bool canBeWritten ( MStatus * ReturnStatus=NULL) const
bool hasAttribute (const MString & name , MStatus * ReturnStatus=NULL) const
MObject getAliasAttr (bool force, MStatus * ReturnStatus=NULL)
bool setAlias (const MString & alias,const MString & name , const MPlug & plug, bool add=true, MStatus * ReturnStatus=NULL)
bool findAlias (const MString & alias, MObject & attrObj, MStatus * ReturnStatus=NULL) const
bool getAliasList ( MStringArray & strArray, MStatus * ReturnStatus=NULL)
MString plugsAlias (const MPlug & plug, MStatus * ReturnStatus=NULL)
public
NO SCRIPT SUPPORT
MFnDependencyNode ( const MObject & object, MStatus * ReturnStatus = NULL )
bool getPlugsAlias (const MPlug & plug, MString & aliasName, MStatus * ReturnStatus=NULL)
NO SCRIPT SUPPORT

Inherited from MFnBase:

public members:

virtual MFn::Type type () const
bool hasObj ( MFn::Type ) const
bool hasObj ( const MObject & ) const
MObject object ( MStatus * ReturnStatus = NULL ) const
virtual MStatus setObject ( MObject & object )
virtual MStatus setObject ( const MObject & object )

Documentation

MFnNumericData allows the manipulation of nodes in the dependency graph
Description

MFnDependencyNode allows the creation and manipulation of dependency graph nodes. Traversal of the dependency graph is possible using the getConnections method.

This function set does not support creation or removal of connections. MDGModifier should be used for that purpose.

Functions

MFnDependencyNode:: MFnDependencyNode ()

Description

Default class constructor. The function set is not attached to an MObject.

MFnDependencyNode:: MFnDependencyNode ( MObject & object, MStatus * ReturnStatus )

Description

Class constructor that initializes the function set to the given MObject.

Arguments

  • object the MObject to attach the function set to
  • ReturnStatus the return status
    • MS::kSuccess if the function set is successfully attached
    • MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

MFnDependencyNode:: MFnDependencyNode ( const MObject & object, MStatus * ReturnStatus )

Description

Class constructor that initializes the function set to the given constant MObject.

Arguments

  • object the const MObject to attach the function set to
  • ReturnStatus the return status
    • MS::kSuccess if the function set is successfully attached
    • MS::kInvalidParameter if the MObject does not represent a valid Maya object or if the function set is not allowed to attach to this MObject

MFnDependencyNode:: ~MFnDependencyNode ()

Description

The class destructor.

MFn::Type MFnDependencyNode:: type () const

Description

Return the type of this function set.

Return Value

  • the constant MFn::kDependencyNode

MObject MFnDependencyNode:: create ( const MTypeId & typeId , MStatus * ReturnStatus )

Description

Creates a new dependency node with the given type tag. The new node is placed into the dependency graph.

If the node is a DAG node, it will be parented to a transform.

The initial name for the node will be the node's "typeName" followed by a number to make the instance unique. For example, the first transform node created will be named "transform1".

Arguments

  • typeId type id of node to be created
  • ReturnStatus return status

Return Value

  • a pointer to the new dependency node object

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure node type is not recognised
  • MS::kLicenseFailure application not licensed for attempted operation
  • MS::kInsufficientMemory out of memory

MObject MFnDependencyNode:: create ( const MTypeId & typeId , const MString & name , MStatus * ReturnStatus )

Description

Creates a new dependency node with the given type tag. The new node is placed into the dependency graph.

If the node is a DAG node, it will be parented to a transform.

Arguments

  • typeId type id of node to be created
  • name the name to be assigned to the new node If the node's name is not unique, it will be given a unique name by changing its numerical suffix. For example, if this node is called "myNode" and a node by the same name exists, this node will be renamed to "myNode1".
  • ReturnStatus return status

Return Value

  • a pointer to the new dependency node object

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure node type is not recognised
  • MS::kLicenseFailure application not licensed for attempted operation
  • MS::kInsufficientMemory out of memory

MObject MFnDependencyNode:: create ( const MString & type , MStatus * ReturnStatus )

Description

Creates a new dependency node with the given type. The new node is placed into the dependency graph.

If the node is a DAG node, it will be parented to a transform.

The initial name for the node will be the node's "typeName" followed by a number to make the instance unique. For example, the first transform node created will be named "transform1".

Arguments

  • type int name for the type of dependency node
  • ReturnStatus return status

Return Value

  • a pointer to the new dependency node object

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure node type is not recognised
  • MS::kLicenseFailure application not licensed for attempted operation
  • MS::kInsufficientMemory out of memory

MObject MFnDependencyNode:: create ( const MString & type , const MString & name , MStatus * ReturnStatus )

Description

Creates a new dependency node with the given type. The new node is placed into the dependency graph.

If the node is a DAG node, it will be parented to a transform.

Arguments

  • type int name for the type of dependency node
  • name the name to be assigned to the new node If the node's name is not unique, it will be given a unique name by changing its numerical suffix. For example, if this node is called "myNode" and a node by the same name exists, this node will be renamed to "myNode1".
  • ReturnStatus return status

Return Value

  • a pointer to the new dependency node object

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure node type is not recognised
  • MS::kLicenseFailure application not licensed for attempted operation
  • MS::kInsufficientMemory out of memory

MTypeId MFnDependencyNode:: typeId ( MStatus * ReturnStatus ) const

Description

Returns the type id of this node. The type is is the 4 byte code that is used in the binary file format to identify the type of this node.

Arguments

  • ReturnStatus return status

Return Value

  • the type id of this node

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set does not have a valid node

MString MFnDependencyNode:: typeName ( MStatus * ReturnStatus ) const

Description

Returns the type name of this node. The string returned is the name of the node type as it is used in the ascii file format.

Arguments

  • ReturnStatus return status

Return Value

  • the type name of this node

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set does not have a valid node

MString MFnDependencyNode:: name ( MStatus * ReturnStatus ) const

Description

Returns the name of this node. Note that if the object the instance of this class is attached to is data instead of being in the graph (ie. the object was created by one of the MFn*Data function sets, or was passed to an MPxNode::compute function in a data block) then the name method will not work.

Arguments

  • ReturnStatus return status

Return Value

  • the name of this node

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set does not have a valid node

MString MFnDependencyNode:: setName ( const MString & name , MStatus * ReturnStatus )

Description

Sets the name of this node.

If the new name conflicts with the name of an existing node then the object will be given a unique name based on the supplied name. If the new name ends in a single '#' it will be replaced with a number that ensures the new name is unique.

When a transform is renamed, any shape nodes beneath the transform that have the same prefix as the old transform name are also renamed. For example, "rename nurbsSphere1 ball" would rename "nurbsSphere1|nurbsSphereShape1" to "ball|ballShape".

The unique name set for the node is returned.

Note that if the object the instance of this class is attached to is data instead of being in the graph (ie. the object was created by one of the MFn*Data function sets, or was passed to an MPxNode::compute function in a data block) then the setName method will not work.

Arguments

  • name the new name for the node
  • ReturnStatus return status

Return Value

  • The new name of the node.

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set does not have a valid node

MStatus MFnDependencyNode:: getConnections ( MPlugArray & array ) const

Description

Get all of the current connections to this node as an array of plugs.

Arguments

  • array storage for the array of plugs

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure node has no connections

MObject MFnDependencyNode:: attribute ( const MString & attrName, MStatus * ReturnStatus ) const

Description

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

Arguments

  • attrName name of the attribute to find
  • ReturnStatus return status

Return Value

  • a pointer to the attribute

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set does not have a valid object, or the given attribute was not found

MObject MFnDependencyNode:: attribute ( unsigned int index, MStatus * ReturnStatus ) const

Description

Finds the attribute of this node at the given index. Index order is based on the order in which the attributes were added to the node.

Arguments

  • index the index of the attribute
  • ReturnStatus return status

Return Value

  • a pointer to the attribute

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set does not have a valid object, or the index is out of range

MObject MFnDependencyNode:: reorderedAttribute ( unsigned int index, MStatus * ReturnStatus ) const

Description

Some nodes, such as the various animCurve nodes, require that their attributes be set in a specific order for proper operation. Usually this ordering is only important when the node is being created during file I/O.

The attribute(index) method above returns the attributes according to the order in which they were originally added to the node.

This method returns the attributes according to the reordering, if any, which is required by the node.

Arguments

  • index the reordered index of the attribute
  • ReturnStatus return status

Return Value

  • a pointer to the attribute

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set does not have a valid object, or the index is out of range

MFnDependencyNode::MAttrClass MFnDependencyNode:: attributeClass ( const MObject & attribute , MStatus * ReturnStatus ) const

Description

Returns the class (normal, local dynamic, global dynamic) of the specified attribute.

Arguments

  • attr the attribute to check
  • ReturnStatus return status

Return Value

  • the class of the attribute. If the node does not have the specified attribute, then kInvalidAttr is returned as the class.

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set does not have a valid object

MStatus MFnDependencyNode:: getAffectedAttributes ( const MObject & attr, MObjectArray & affectedAttributes ) const

Description

Returns an array of attributes that are affected by the attribute passed in. That is, when the given attribute, attr is marked dirty (changed) all the affectedAttributes attributes will also be marked dirty. For nodes defined in plug-ins this call returns all those attributes that were marked as being affected by the given one via the MPxNode::attributeAffects call.

It should be noted that dynamic attributes cannot be handled by this method. This is because the attribute affects dependencies are statically defined when the node is created. An alternate approach which works for dynamic as well as non-dynamic attributes is available through MPxNode::setDependentsDirty override.

Arguments

  • attr the attribute to check
  • affectedAttributes an array of attributes affected by attr

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure operation failed
  • MS::kInvalidParameter function set is not bound to a dependency node or the first parameter is not an attribute

MStatus MFnDependencyNode:: getAffectedByAttributes ( const MObject & attr, MObjectArray & affectedByAttributes ) const

Description

Returns an array of attributes that affect the attribute passed in, attr. That is, when one of the attributes in affectedByAttributes is marked dirty (changed) then attr will also be marked dirty. For nodes defined in plug-ins this call returns all those attributes that were marked as affecting the given one via the MPxNode::attributeAffects call.

It should be noted that dynamic attributes cannot be handled by this method. This is because the attribute affects dependencies are statically defined when the node is created. An alternate approach which works for dynamic as well as non-dynamic attributes is available through MPxNode::setDependentsDirty override.

Arguments

  • attr the attribute to check
  • affectedByAttributes an array of attributes affected by attr

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure operation failed
  • MS::kInvalidParameter function set is not bound to a dependency node or the first parameter is not an attribute

unsigned int MFnDependencyNode:: attributeCount ( MStatus * ReturnStatus ) const

Description

Returns the number of attributes that this node has.

Arguments

  • ReturnStatus return status

Return Value

  • the attribute count

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set does not have a valid object

MPlug MFnDependencyNode:: findPlug ( const MObject & attr, MStatus * ReturnStatus ) const

Description

OBSOLETE. Use the findPlug( MObject&, bool, MStatus* ) method instead.

MPlug MFnDependencyNode:: findPlug ( const MObject & attr, bool wantNetworkedPlug, MStatus * ReturnStatus ) const

Description

Attempt to find a plug for the given attribute. This method will first try to find the networked version of the plug if requested. The networked version of a plug is one that currently exists in the dependency graph at a particular connection point. If a networked version is not found, then a standard non-networked plug is returned.

A non-networked plug is not actually used by the dependency graph, but is used to represent the same connections. Every time an operation is performed on a non-networked plug, a search is made for the networked version of the plug.

Networked and non-networked plugs behave the same, but networked plugs are much more efficient if used for multiple operations.

Networked plugs should be avoided if you will be deleting connections to the plug.

Arguments

  • attr attribute whose plug we wish to find
  • wantNetworkedPlug if true, request a networked plug if it is available
  • ReturnStatus return status

Return Value

  • the plug

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set does not have a valid object, or the plug could not be found

MPlug MFnDependencyNode:: findPlug ( const MString & attrName, MStatus * ReturnStatus ) const

Description

OBSOLETE: Use the findPlug( MString&, bool, MStatus* ) method instead.

MPlug MFnDependencyNode:: findPlug ( const MString & attrName, bool wantNetworkedPlug, MStatus * ReturnStatus ) const

Description

Attempt to find a plug for the given attribute. This method will first try to find the networked version of the plug if requested. The networked version of a plug is one that currently exists in the dependency graph at a particular connection point. If a networked version is not found, then a standard non-networked plug is returned.

A non-networked plug is not actually used by the dependency graph, but is used to represent the same connections. Every time an operation is performed on a non-networked plug, a search is made for the networked version of the plug.

Networked and non-networked plugs behave the same, but networked plugs are much more efficient if used for multiple operations.

Networked plugs should be avoided if you will be deleting connections to the plug.

Arguments

  • attrName name of attribute whose plug we wish to find
  • wantNetworkedPlug if true, request a networked plug if it is available
  • ReturnStatus return status

Return Value

  • the plug

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set does not have a valid object, or the plug could not be found

MStatus MFnDependencyNode:: addAttribute ( const MObject & attr, MFnDependencyNode::MAttrClass type )

Description

Add a new attibute to this node. Note that this operation will fail if the given type parameter is not MFnDependencyNode::kLocalDynamicAttr.

Arguments

  • attr new attribute
  • type class of attribute to add

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kInvalidParameter attr is not a valid attribute object, or type did not specify a local dynamic attribute type.
  • MS::kFailure function set does not have a valid object, or the addition of the new attribute failed

MStatus MFnDependencyNode:: removeAttribute ( const MObject & attribute , MFnDependencyNode::MAttrClass type )

Description

Remove an attribute from a node.

Note: After a successful call to this method, the MObject passed to it will have been reset to MObject::kNullObj because the attribute it referenced no longer exists. Thus no function sets, such as MFnAttribute, should be attached to the MObject at the time this call is made.

Arguments

  • attr attribute to remove
  • type class of attribute to remove (must be either MFnDependencyNode::kLocalDynamicAttr or MFnDependencyNode::kGlobalDynamicAttr)

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kInvalidParameter attr is not a valid attribute object, or type did not specify a dynamic attribute type.
  • MS::kFailure function set does not have a valid object, or the removal of the attribute failed

MPxNode * MFnDependencyNode:: userNode ( MStatus * ReturnStatus ) const

Description

If the function set's node is a plug-in node, then this method will extract the MPxNode pointer from it. This method should only be used on node types that are provided by the plug-in calling this method.

Arguments

  • ReturnStatus return status

Return Value

  • a pointer to the user data (NULL if not a plug-in node)

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set does not have a valid object, or the removal of the attribute failed

bool MFnDependencyNode:: isFromReferencedFile ( MStatus * ReturnStatus) const

Description

Indicates whether or not this node came from a referenced file. If it did, the node will be marked as read-only in the scene and changes to the node's attributes will be saved in the main scene file, not the referenced from from which the node came.

Arguments

  • ReturnStatus return status

Return Value

  • true the node came from a referenced file
  • false the node did not come from a referenced file

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set does not have a valid node

bool MFnDependencyNode:: isNewAttribute ( const MObject & attr, MStatus * ReturnStatus ) const

Description

Indicates whether or not the specified attribute was added to this node within the current scene.

For nodes from referenced files, this method will only return true if the attribute was added to the node after the reference file was loaded into the scene.

For all other nodes, this method will return true if the attribute is dynamic (i.e. not one of the node's original, permanent attributes).

Arguments

  • ReturnStatus return status

Return Value

  • true the attribute was added within the current scene
  • false the attribute is permanent or was added within a referenced file.

Status Codes

  • MS::kSuccess operation successful
  • MS::kInvalidParameter no such attribute on this node
  • MS::kFailure function set does not have a valid node

bool MFnDependencyNode:: isShared ( MStatus * ReturnStatus) const

Description

Indicates whether or not this node is shared. This comes into play when you attempt to create a new node with the same name as an existing node. If the existing node is shared, then no new node will be created. If the existing node is not shared, then the new node will be created and given a different name.

For example, if you import several scene files into a single scene, they may all attempt to create their own 'defaultResolution' node. However, since this node is shared, only one such node will be created and the other requests will be ignored.

The concept of "sharing" can also be found in the "createNode -shared" flag found in MEL which, if specified causes an implicit node to be created (or not created, if it is already present).

Arguments

  • ReturnStatus return status

Return Value

  • true the node is shared
  • false the node is not shared

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set does not have a valid node

bool MFnDependencyNode:: hasUniqueName ( MStatus * ReturnStatus) const

Description

Indicates whether or not this node's name is unique within the scene.

Arguments

  • ReturnStatus return status

Return Value

  • true the node's name is unique within scene
  • false the node is not not unique within scene

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set does not have a valid node

MString MFnDependencyNode:: parentNamespace ( MStatus * ReturnStatus) const

Description

Returns the name of the namespace in which this node resides. Namespaces are often used when importing files to prevent name collisions.

Arguments

  • ReturnStatus return status

Return Value

The name of the namespace in which this node exists. This will be a colon separated path. If the object is in the root namespace, then an empty string will be returned.

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set does not have a valid node

bool MFnDependencyNode:: isLocked ( MStatus * ReturnStatus) const

Description

Indicates whether or not this node is locked. See the setLocked method for more information on what it means for a node to be locked.

Arguments

  • ReturnStatus return status

Return Value

  • true the node is locked
  • false the node is not locked

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set does not have a valid node

MStatus MFnDependencyNode:: setLocked (bool lock)

Description

Locks or unlocks this node.

If a node is locked, it may not be deleted, renamed, or reparented; it may not have attributes added or removed; attributes which are unlocked may not be locked and those which are already locked may not be unlocked.

Arguments

  • lock If true then node will be locked.

Return Value

  • return status

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set does not have a valid node

MString MFnDependencyNode:: classification ( const MString & nodeTypeName )

Description

Retrieves the classification string for a node type. 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.

Arguments

  • nodeTypeName The name of the node for which a classification should be retrieved. Since this is a static method, the typeName method of this class can be used for this parameter if it is desired to get the classification for the attached node.

Return Value

  • classificationString The classification string. If the node does not have an associated classification, an empty string will be returned.

unsigned int MFnDependencyNode:: allocateFlag ( const MString pluginName, MStatus * ReturnStatus )

Description

Allocates a node flag for sole use by the caller. Note that the flag is not specific to any one node but is made available to the caller on all nodes. Furthermore, node flags only persist for the duration of the current Maya session: they are not saved with the scene.

deallocateFlag must be called when a flag is no longer needed.

There are a total of just 8 flags available, so plugins should strive not to hold onto flags for extended periods of time as that might interfere with the needs of other plugins.

When a plugin is unloaded, deallocateAllFlags is automatically invoked to free up any node flags still held by the plugin.

Arguments

  • pluginName The name of the plugin which is allocating the flag. A plugin's name can be retrieved by calling MFnPlugin::name() within its initializePlugin() or uninitializePlugin() functions.

  • ReturnStatus Return status.

Return Value

  • flag The newly-allocated flag.

Status Codes

  • MS::kSuccess Operation successful.
  • MS::kNotFound No unallocated flags are available.
  • MS::kInvalidParameter The specified plugin is not loaded.

MStatus MFnDependencyNode:: deallocateFlag ( const MString pluginName, unsigned int flag )

Description

Deallocates a node flag which was previously allocated by a call to allocateFlag. The flag subsequently becomes available for reallocation and use by someone else.

Arguments

  • pluginName The name of the plugin which allocated the flag. A plugin's name can be retrieved by calling MFnPlugin::name() within its initializePlugin() or uninitializePlugin() functions.

  • flag Flag to deallocate.

Return Value

  • MS::kSuccess Operation successful.
  • MS::kInvalidParameter Flag number is out of range.
  • MS::kNotFound Flag was not allocated by the plugin.

MStatus MFnDependencyNode:: deallocateAllFlags (const MString pluginName)

Description

Deallocates all of the node flags which are currently allocated to the specified plugin. The deallocated flags immediately become available for use by any plugin.

Arguments

  • pluginName The name of the plugin whose flags are to be deallocated. A plugin's name can be retrieved by calling MFnPlugin::name() within its initializePlugin() or uninitializePlugin() functions.

Return Value

  • MS::kSuccess Operation successful.
  • MS::kInvalidParemeter The pluginName was invalid.

MStatus MFnDependencyNode:: setFlag (unsigned int flag, bool state)

Description

Sets the state of the specified flag for the node.

The flag number must have been previously obtained through a call to allocateFlag.

Arguments

  • flag flag to set
  • state new state to which the flag will be set

Return Value

  • MS::kSuccess operation successful
  • MS::kInvalidParameter flag number is out of range
  • MS::kNotFound flag has not been properly allocated
  • MS::kFailure function set does not have a valid node

bool MFnDependencyNode:: isFlagSet (unsigned int flag, MStatus * ReturnStatus) const

Description

Retrieves the current state of the specified flag for a node.

The flag must have been previously obtained through a call to allocateFlag.

Arguments

  • flag number of the flag to retrieve.
  • ReturnStatus return status

Return Value

  • state current state of the flag

Status Codes

  • MS::kSuccess operation successful
  • MS::kInvalidParameter flag number is out of range
  • MS::kNotFound flag has not been properly allocated
  • MS::kFailure function set does not have a valid node

bool MFnDependencyNode:: isDefaultNode ( MStatus * ReturnStatus) const

Description

Returns true if the node is a default node.

A default node is one that Maya creates automatically and does not get saved out with the scene, although some of its attribute values may.

Arguments

  • ReturnStatus return status

Return Value

  • state true if the node is default

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set does not have a valid node

MStatus MFnDependencyNode:: setDoNotWrite ( bool flag )

Description

Use this method to mark the "do not write" state of this node. If set, this node will not be saved when the Maya model is written out.

NOTES: 1. If this node is a DAG and has a parent or children, the "do not write" flag of the parent or children will not be set. It is the developer’s responsibility to ensure that the resulting scene file is capable of being read in without errors due to unwritten nodes.

Arguments

  • flag True if the node should not be saved.

bool MFnDependencyNode:: canBeWritten ( MStatus * ReturnStatus) const

Description

Returns true if the node can be written/exported to scene files.

Note that if a node is marked as being shared (see MFnDependencyNode::isShared) that overrides being marked as not writable. So shared nodes can be written, even if not marked as writable.

Arguments

  • ReturnStatus return status

Return Value

  • state true if the node can be written

Status Codes

  • MS::kSuccess operation successful
  • MS::kFailure function set does not have a valid node

bool MFnDependencyNode:: hasAttribute (const MString & attrName, MStatus * ReturnStatus) const

Description

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

Arguments

  • ReturnStatus return status

Return Value

  • state true if the node has attribute

Status Codes

  • MS::kSuccess if attribute is found.
  • MS::kFailure node does not have the attribute.

MObject MFnDependencyNode:: getAliasAttr (bool force, MStatus * ReturnStatus)

Description

The function returns the alias attribute list; returns NULL if it doesn't exist. If the value of argument 'force' is true, an alias attribute is created if one doesn't exist.

Arguments

  • force To indicate whether the alias attr should be created.
  • ReturnStatus return status

Return Value

  • MObject The MObject corresponding to the alias attribute.

Status Codes

  • MS::kSuccess if method is successful.
  • MS::kFailure if an object error occurs.

bool MFnDependencyNode:: setAlias ( const MString & alias, const MString & name , const MPlug & plug, bool add, MStatus * ReturnStatus )

Description

The function sets the alias attribute.

Arguments

  • alias name of the alias.
  • name name of the attribute for which we need an alias.
  • plug plug to the attribute for which we need an alias.
  • add boolean; a value of false indicates that the alias name has to be removed from the alias attribute list. Default value is true.
  • ReturnStatus return status

Return Value

  • bool boolean indicating if the alias has been set properly.

Status Codes

  • MS::kSuccess if method is successful.
  • MS::kFailure if an object error occurs.

bool MFnDependencyNode:: findAlias (const MString & alias, MObject & attrObj, MStatus * ReturnStatus) const

Description

The function looks for an aliased attribute on this node with the given name

Arguments

  • alias name of the alias attribute.
  • attrObj MObject of the alias attribute.
  • ReturnStatus return status

Return Value

  • bool boolean indicating if the alias was found.

Status Codes

  • MS::kSuccess if method is successful.
  • MS::kFailure if an object error occurs.

bool MFnDependencyNode:: getAliasList ( MStringArray & strArray, MStatus * ReturnStatus)

Description

The function sets a pointer to the list of all attribute aliases for this node.

Arguments

  • strArray Pointer to MStringArray, which will be filled.
  • ReturnStatus return status

Return Value

  • bool returns boolean if any alias was found.

Status Codes

  • MS::kSuccess if method is successful.
  • MS::kFailure if an object error occurs.

bool MFnDependencyNode:: getPlugsAlias (const MPlug & plug, MString & aliasName, MStatus * ReturnStatus)

Description

The function returns the name of the alias on whose attribute the given plug is created.

Python Notes

This method is not supported in Python. Please see plugsAlias()

Arguments

  • plug the plug on the attribute.
  • aliasName Name of the alias attribute.
  • ReturnStatus return status

Return Value

  • bool boolean indicating if the alias was found.

Status Codes

  • MS::kSuccess if the method is successful.
  • MS::kFailure if an object error occurs.

MString MFnDependencyNode:: plugsAlias (const MPlug & plug, MStatus * ReturnStatus)

Description

The function returns the name of the alias on whose attribute the given plug is created.

Arguments

  • plug the plug on the attribute.
  • ReturnStatus return status. See below.

Return Value

  • Name of the alias attribute.

Status Codes

  • MS::kSuccess if the method is successful.
  • MS::kFailure if an object error occurs.

Direct child classes:

- MFnWireDeformer
- MFnSet
- MFnRenderLayer
- MFnPhongEShader
- MFnPartition
- MFnMotionPath
- MFnLayeredShader
- MFnLatticeDeformer
- MFnLambertShader
- MFnIkSolver
- MFnGeometryFilter
- MFnExpression
- MFnDagNode
- MFnClip
- MFnBlendShapeDeformer
- MFnAnisotropyShader
- MFnAnimCurve

Autodesk® Maya® 2008 © 1997-2007 Autodesk, Inc. All rights reserved. doc++ Copyright