MFnDependencyNode

Base Class

MFnBase

Constants

Name Type Description
Attribute Classes
kLocalDynamicAttr int Dynamically added to a specific node, after its creation.
kNormalAttr int Part of node's definition.
kExtensionAttr int Dynamically added to all nodes of a given type, plus derived types.
kInvalidAttr int None of the above.
DG Timer States
kTimerOff int  
kTimerOn int  
kTimerUninitialized int  
kTimerInvalidState int  
DG Timer Metrics
kTimerMetric_callback int Time spent within node callbacks for this node.
kTimerMetric_compute int Time spent within the compute method for this node.
kTimerMetric_dirty int Time spent propogating dirty messages from this node.
kTimerMetric_draw int Time spent drawing this node.
kTimerMetric_fetch int Time spent fetching data from plugs.
kTimerMetric_callbackViaAPI int Time spent in callbacks which were registered through the API. (NOT IMPLEMENTED)
kTimerMetric_callbackNotViaAPI int Time spent in callbacks not registered through the API (i.e internal Maya callbacks). (NOT IMPLEMENTED)
kTimerMetric_computeDuringCallback int Time spent in this node's compute while executing node callbacks on any node.
kTimerMetric_computeNotDuringCallback int Time spent in this nodes compute when not executing any node callbacks on any nodes.
DG Timer Types
kTimerType_self int Time spent performing an operation, not including any time spent by child operations.
kTimerType_inclusive int Time spent performing an operation including all time spent by child operations.
kTimerType_count int The number of operations that occurred.

Static Methods

Name Parameters Returns Description
allocateFlag(plugin) plugin - string int Allocates a flag on all nodes for use by the named plugin. Returns the flag's index. Raises a ValueError if there are no unallocated node flags available.
classification(nodeType) nodeType - string string Returns the classification string for the named nodeType.
deallocateAllFlags(plugin) plugin - string None Deallocates all node flags which are currently allocated to the named plugin.
deallocateFlag(plugin, flag) plugin - string
flag - int
None Deallocates the specified node flag, which was previously allocated by the named plugin using allocateFlag().

Constructors

Signature Parameters Description
MFnDependencyNode()   Default constructor. Returns a new MFnDependencyNode function set with no node attached.
MFnDependencyNode(node) object - MObject Returns a new MFnDependencyNode function set, attached to the specified Maya node.

Object Methods

Signature Parameters Returns Description
addAttribute(attribute) attribute - MObject Reference to self. Adds a new dynamic attribute to the node.
attribute(index) index - int MObject Returns the node's index'th attribute, based on the order in which they were added to the node.
attribute(name) name - string MObject Returns the attribute with the given name.
attributeClass(attribute) attribute - MObject Attribute Class constant Returns the class of the specified attribute.
attributeCount()   int Returns the number of attributes on the node.
canBeWritten()   bool Returns true if the node will be written to file.
create(typeId, nodeName=None) typeId - MTypeId
nodeName - string
MObject Creates a new node of the given type, using the nodeName provided, attaches it to the function set and returns it in an MObject. If no nodeName is given the node's type name will be used, followed by a number to ensure uniqueness.
create(typeName, nodeName=None) typeName - string
nodeName - string
MObject Creates a new node of the given type, using the nodeName provided, attaches it to the function set and returns it in an MObject. If no nodeName is given the node's type name will be used, followed by a number to ensure uniqueness.
dgCallbackIds(timerType, callbackName) timerType - DG Timer Type constant
callbackName - string
(MCallbackIdArray, MDoubleArray) Returns a tuple containing an array of callback ids as its first element and an array of doubles as its second element. These represent the callback timer values for the specified timerType and callbackName, separated out per callback ID.
dgCallbacks(type) type - DG Timer Type constant ([string, ...], MDoubleArray) Returns a tuple containing a list of callback type names as its first element and an array of doubles as its second element. These represent the callback timer values for the specified timer type, grouped by type of callback.
dgTimer(metric, type) metric - DG Timer Metric constant
type - DG Timer Type constant
float Returns the timer value for the given metric and type.
dgTimerOff()   Reference to self Turns DG timing off for this node.
dgTimerOn()   Reference to self Turns DG timing on for this node.
dgTimerQueryState()   DG Timer State constant Returns the current DG timer state for this node.
dgTimerReset()   Reference to self Resets all DG timers for this node.
findAlias(alias) alias - string MObject Returns the attribute which has the given alias or MObject::kNullObj if none.
findPlug(attr, wantNetworkedPlug) attr - string or MObject
wantNetworkedPlug - bool
MPlug Returns a plug for the given attribute, which may be specified either by name or by MObject.
getAffectedAttributes(attribute) attribute - MObject MObjectArray Returns all of the attributes which are affected by the specified attribute.
getAffectingAttributes(attribute) attribute - MObject MObjectArray Returns all of the attributes which affect the specified attribute.
getAliasAttr(force) force - bool MObject Returns the node's alias attribute, which is a special attribute used to store information about the node's attribute aliases.
getAliasList()   tuple of tuples of strings Returns all of the node's attribute aliases in a tuple. Each element of the tuple is itself a tuple containing a pair of strings representing the attribute's alias and its real name.
getConnections()   MPlugArray Returns all the plugs which are connected to attributes of this node.
hasAttribute(name) name - string bool Returns True if the node has an attribute with the given name.
hasUniqueName()   bool Returns True if the node's name is unique.
isFlagSet(flag) flag - int bool Returns the state of the specified node flag, which must previously have been allocated by a call to allocateFlag().
isNewAttribute(attribute) attribute - MObject bool Returns True if the specified attribute was added in the current scene, and not by by one of its referenced files.
name()   string Returns the node's name.
plugsAlias(plug) plug - MPlug string Returns the alias for the plug's attribute or the empty string if that attribute has no alias.
removeAttribute(attribute) attribute - MObject Reference to self. Removes a dynamic attribute from the node.
reorderedAttribute(index) index - int MObject Returns the node's index'th attribute, based on the order in which they are written to file.
setAlias(alias, attrName, plug, add=True) alias - string
attrName - string
plug - MPlug
add - bool
bool Adds or removes an attribute alias. Returns False if the alias to be added already exists, or if the alias to be removed does not exist.
setDoNotWrite(flag) flag - bool Reference to self. Used to prevent the node from being written to file.
setFlag(flag, state) flag - int
state - bool
Reference to self Sets the state of the specified node flag, which must previously have been allocated by a call to allocateFlag().
setName(name) name - string string Sets the node's name. If there is a conflict with another node the name will be modified to make it unique. The name actually used is returned.
userNode()   MPxNode or None If the node is a plug-in node, its proxy object is returned, otherwise None is returned.

Object Attributes

Name Type Access Description
isDefaultNode bool R True if node is one of Maya's default nodes.
isFromReferencedFile bool R True if node is from a referenced file.
isLocked bool RW True if node is locked against changes.
isShared bool R True if node is shared.
namespace string R Namespace in which node resides.
pluginName string R Name of plugin which supplies the node type.
typeId MTypeId R Node's type id.
typeName string R Node's type name.

Sequence Support

None.

Number Support

None.

Comparison Support

None.

© 2011 Autodesk, Inc. All rights reserved.