OpenMaya.MFnAttribute Class Reference

Class Description

Base class for attribute functionsets.

Method resolution order:
-   MFnAttribute
-   MFnBase
-   __builtin__.object

Base Class

MFnBase<h2>Constructors

SignatureParametersDescription
MFnAttribute()  

Default constructor. Returns a new MFnAttribute function set with no Maya object attached.

MFnAttribute(object) object - MObject

Returns a new MFnAttribute function set, attached to the specified Maya object.

 


+ Inheritance diagram for OpenMaya.MFnAttribute:

Public Member Functions

__init__ ()
 
accepts ()
 
acceptsAttribute ()
 
addToCategory ()
 
getAddAttrCmd ()
 
hasCategory ()
 
setNiceNameOverride ()
 
- Public Member Functions inherited from OpenMaya.MFnBase
__init__ ()
 
hasObj ()
 
object ()
 
setObject ()
 
type ()
 

Static Public Attributes

Disconnect Behavior
int kDelete = 0
 
int kNothing = 2
 
int kReset = 1
 

Properties

 affectsAppearance
 
 affectsWorldSpace
 
 array
 
 cached
 
 channelBox
 
 connectable
 
 disconnectBehavior
 
 dynamic
 
 extension
 
 hidden
 
 indeterminant
 
 indexMatters
 
 internal
 
 isProxyAttribute
 
 keyable
 
 name
 
 parent
 
 readable
 
 renderSource
 
 shortName
 
 storable
 
 usedAsColor
 
 usedAsFilename
 
 usesArrayDataBuilder
 
 worldSpace
 
 writable
 

Constructor & Destructor Documentation

OpenMaya.MFnAttribute.__init__ ( )
x.__init__(...) initializes x; see help(type(x)) for signature

Member Function Documentation

OpenMaya.MFnAttribute.accepts ( )
Returns True if this attribute can accept a connection of the given type.
Signature: accepts(type)
Parameters: type - MTypeId or MFn Type constant
Returns: bool
Description: Returns True if this attribute can accept a connection of the given type.
OpenMaya.MFnAttribute.acceptsAttribute ( )
Returns True if this attribute can accept a connection with the given attribute.
OpenMaya.MFnAttribute.addToCategory ( )
Adds the attribute to a category
OpenMaya.MFnAttribute.getAddAttrCmd ( )
Returns a string containing a MEL 'addAttr' command capable of recreating the attribute.
Signature: getAddAttrCmd(longFlags=False)
Parameters: longFlags - bool
Returns: string
Description: Returns a string containing the addAttr command which would be required to recreate the attribute. The command includes the terminating semicolon and is formatted as if for use with a selected node, meaning that it contains no node name. If longFlags is True then the long flag names will be used, otherwise their short names will be used.
OpenMaya.MFnAttribute.hasCategory ( )
Checks to see if the attribute has a given category
OpenMaya.MFnAttribute.setNiceNameOverride ( )
Sets a nice UI name for this attribute rather than using the default derived from it's long name.

Member Data Documentation

OpenMaya.MFnAttribute.kDelete = 0
static
Name: kDelete
Type: int
Description: Delete array element (array attributes only).
OpenMaya.MFnAttribute.kNothing = 2
static
Name: kNothing
Type: int
Description: Do nothing to the attribute's value.
OpenMaya.MFnAttribute.kReset = 1
static
Name: kReset
Type: int
Description: Reset the attribute to its default.

Property Documentation

OpenMaya.MFnAttribute.affectsAppearance
static
 Does the attribute affect how the node is drawn in Maya's viewport?
Name: affectsAppearance
Type: bool
Access: RW
Description: Does attr affect appearance of object when rendered in the viewport?
OpenMaya.MFnAttribute.affectsWorldSpace
static
 Does the attribute affect the node's worldSpace matrix?
Name: affectsWorldSpace
Type: bool
Access: RW
Description: DAG nodes only. Does the attr affect the node's world-space state?
OpenMaya.MFnAttribute.array
static
 Is the attribute an array?
Name: array
Type: bool
Access: RW
Description: Is attr an array?
OpenMaya.MFnAttribute.cached
static
 Should the attribute's value be cached in the datablock?
Name: cached
Type: bool
Access: RW
Description: Should attr value be cached in the datablock?
OpenMaya.MFnAttribute.channelBox
static
 Should the attribute be displayed in the Channel Box?
Name: channelBox
Type: bool
Access: RW
Description: Should attr appear in Channel Box?
OpenMaya.MFnAttribute.connectable
static
 Can connections be made to the attribute?
Name: connectable
Type: bool
Access: RW
Description: Is attr connectable?
OpenMaya.MFnAttribute.disconnectBehavior
static
 What should happen when the attribute loses an incoming connection?
Name: disconnectBehavior
Type: Disconnect Behaviour constant
Access: RW
Description: What should happen when attr loses an incoming connection?
OpenMaya.MFnAttribute.dynamic
static
 Is the attribute a dynamic attribute?
Name: dynamic
Type: bool
Access: R
Description: Is it a dynamic attr?
OpenMaya.MFnAttribute.extension
static
 Is the attribute an extension attribute?
Name: extension
Type: bool
Access: R
Description: Is it an extension attr?
OpenMaya.MFnAttribute.hidden
static
 If True the attribute will not be displayed in the Attribute Editor.
Name: hidden
Type: bool
Access: RW
Description: If True attr will not be displayed in the Attribute Editor.
OpenMaya.MFnAttribute.indeterminant
static
 Hint to DG that this attribute may not always be used when computing the attributes which are dependent upon it.
Name: indeterminant
Type: bool
Access: RW
Description: Hint to DG that this attr may not always be used when computing the attrs which are dependent upon it.
OpenMaya.MFnAttribute.indexMatters
static
 If False, connectAttr -nextAvailable can be used with this attribute. If True then an explicit index must be provided.
Name: indexMatters
Type: bool
Access: RW
Description: If False, connectAttr -nextAvailable can be used with this attr. If True then an explicit index must be provided.
OpenMaya.MFnAttribute.internal
static
 Will the node handle the attribute's data storage itself, outside of the node's data block?
Name: internal
Type: bool
Access: RW
Description: Will the node handle the attr's data storage itself, outside of the node's data block?
OpenMaya.MFnAttribute.isProxyAttribute
static
 Does the attribute is a proxy attribute?
OpenMaya.MFnAttribute.keyable
static
 Can keys be set on the attribute?
Name: keyable
Type: bool
Access: RW
Description: Can keys be set on attr?
OpenMaya.MFnAttribute.name
static
 Attribute's long name.
Name: name
Type: string
Access: R
Description: Attr's long name.
OpenMaya.MFnAttribute.parent
static
 Parent attribute. MObject::kNullObj if attr has no parent.
Name: parent
Type: MObject
Access: RW
Description: Parent attr. MObject::kNullObj if attr has no parent.
OpenMaya.MFnAttribute.readable
static
 Is the attribute readable?
Name: readable
Type: bool
Access: RW
Description: Is attr readable?
OpenMaya.MFnAttribute.renderSource
static
 Is the attribute a render source?
Name: renderSource
Type: bool
Access: RW
Description: Is attr a render source?
OpenMaya.MFnAttribute.shortName
static
 Attribute's short name.
Name: shortName
Type: string
Access: R
Description: Attr's short name.
OpenMaya.MFnAttribute.storable
static
 Should the attribute's value be preserved when the node is written to file?
Name: storable
Type: bool
Access: RW
Description: Should attr value be stored when written to file?
OpenMaya.MFnAttribute.usedAsColor
static
 Should the attribute be treated as a color in the UI?
Name: usedAsColor
Type: bool
Access: RW
Description: Should attr be treated as a color in the UI?
OpenMaya.MFnAttribute.usedAsFilename
static
 Should the attribute be treated as a file name in the UI?
Name: usedAsFilename
Type: bool
Access: RW
Description: Should attr be treated as a filename in the UI?
OpenMaya.MFnAttribute.usesArrayDataBuilder
static
 Array attributes only: does the attribute create elements using MArrayDataBuilder?
Name: usesArrayDataBuilder
Type: bool
Access: RW
Description: Array attrs only. Does attr create elements using MArrayDataBuilder?
OpenMaya.MFnAttribute.worldSpace
static
 DAG nodes only: if the node is instanced, will the attribute have separate values for each instance?
Name: worldSpace
Type: bool
Access: RW
Description: DAG nodes only. If the node is instanced, will the attr have separate values for each instance?
OpenMaya.MFnAttribute.writable
static
 Is the attribute writable?
Name: writable
Type: bool
Access: RW
Description: Is attr writable?