Python API 2.0 Reference
OpenMaya.MFnAttribute Class Reference
+ Inheritance diagram for OpenMaya.MFnAttribute:

Public Member Functions

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

Static Public Member Functions

def __new__ ()
 
- Static Public Member Functions inherited from OpenMaya.MFnBase
def __new__ ()
 

Static Public Attributes

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

Properties

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

Detailed Description

Base class for attribute functionsets.

Method resolution order:
-   MFnAttribute
-   MFnBase
-   builtins.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.

 


Constructor & Destructor Documentation

def OpenMaya.MFnAttribute.__init__ ( )
Initialize self.  See help(type(self)) for accurate signature.

Member Function Documentation

def OpenMaya.MFnAttribute.__new__ ( )
static
Create and return a new object.  See help(type) for accurate signature.
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.
def OpenMaya.MFnAttribute.acceptsAttribute ( )
Returns True if this attribute can accept a connection with the given attribute.
def 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.
def OpenMaya.MFnAttribute.hasCategory ( )
Checks to see if the attribute has a given category
def 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 = property(...)
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 = property(...)
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 = property(...)
static
 Is the attribute an array?
Name: array
Type: bool
Access: RW
Description: Is attr an array?
OpenMaya.MFnAttribute.cached = property(...)
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 = property(...)
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 = property(...)
static
 Can connections be made to the attribute?
Name: connectable
Type: bool
Access: RW
Description: Is attr connectable?
OpenMaya.MFnAttribute.disconnectBehavior = property(...)
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 = property(...)
static
 Is the attribute a dynamic attribute?
Name: dynamic
Type: bool
Access: R
Description: Is it a dynamic attr?
OpenMaya.MFnAttribute.extension = property(...)
static
 Is the attribute an extension attribute?
Name: extension
Type: bool
Access: R
Description: Is it an extension attr?
OpenMaya.MFnAttribute.hidden = property(...)
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 = property(...)
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 = property(...)
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 = property(...)
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 = property(...)
static
 Does the attribute is a proxy attribute?
OpenMaya.MFnAttribute.keyable = property(...)
static
 Can keys be set on the attribute?
Name: keyable
Type: bool
Access: RW
Description: Can keys be set on attr?
OpenMaya.MFnAttribute.name = property(...)
static
 Attribute's long name.
Name: name
Type: string
Access: R
Description: Attr's long name.
OpenMaya.MFnAttribute.parent = property(...)
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 = property(...)
static
 Is the attribute readable?
Name: readable
Type: bool
Access: RW
Description: Is attr readable?
OpenMaya.MFnAttribute.renderSource = property(...)
static
 Is the attribute a render source?
Name: renderSource
Type: bool
Access: RW
Description: Is attr a render source?
OpenMaya.MFnAttribute.shortName = property(...)
static
 Attribute's short name.
Name: shortName
Type: string
Access: R
Description: Attr's short name.
OpenMaya.MFnAttribute.storable = property(...)
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 = property(...)
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 = property(...)
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 = property(...)
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 = property(...)
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 = property(...)
static
 Is the attribute writable?
Name: writable
Type: bool
Access: RW
Description: Is attr writable?