#include <MFnCompoundAttribute.h>
Compound attribute function set.
MFnCompoundAttribute is the function set for compound dependency node attributes.
Compound attributes allow the grouping of related attributes into a larger unit. It is possible to connect to a compound attribute as a whole, or to any of the individual children.
For example, the three attributes RED, GREEN, and BLUE could be grouped into a compound attribute of type COLOR. It is then possible to connect two COLOR attributes together. This removes the need to connect each child explicitly.
A second use for compound attributes is when there are multi attributes that relate to each other on an element-by-element basis. An example of this is the weighted matrix node that has a multi attribute with matrices that must be matched with the multi attribute that provides the weights for each matrix.
Public Member Functions | |
virtual MFn::Type | type () const |
Function set type. More... | |
virtual | ~MFnCompoundAttribute () |
Destructor. | |
MFnCompoundAttribute () | |
Default constructor. | |
MFnCompoundAttribute (MObject &object, MStatus *ReturnStatus=NULL) | |
Constructor. More... | |
MObject | create (const MString &full, const MString &brief, MStatus *ReturnStatus=NULL) |
Creates a new compound attribute. More... | |
MStatus | addChild (const MObject &child) |
Add a child attribute under this compound attribute. More... | |
MStatus | removeChild (const MObject &child) |
Remove a child attribute from this compound attribute. More... | |
unsigned int | numChildren (MStatus *ReturnStatus=NULL) const |
Returns the number of child attributes that this compound attribute has. More... | |
MObject | child (unsigned int index, MStatus *ReturnStatus=NULL) const |
Get a child of this compound attribute. More... | |
MStatus | getAddAttrCmds (MStringArray &cmds, bool useLongNames=false) const |
Returns a string array containing the addAttr commands which would be required to recreate the attribute and all of its descendents on a node. More... | |
MFnCompoundAttribute (const MObject &object, MStatus *ReturnStatus=NULL) | |
NO SCRIPT SUPPORT. More... | |
Public Member Functions inherited from MFnAttribute | |
virtual | ~MFnAttribute () |
Destructor. | |
MFnAttribute () | |
Default constructor. | |
MFnAttribute (MObject &object, MStatus *ReturnStatus=NULL) | |
Constructor. More... | |
bool | isReadable (MStatus *ReturnStatus=NULL) const |
Returns true if this attribute is readable. More... | |
bool | isWritable (MStatus *ReturnStatus=NULL) const |
Returns true if this attribute is writable. More... | |
bool | isConnectable (MStatus *ReturnStatus=NULL) const |
Returns true if this attribute accepts dependency graph connections. More... | |
bool | isStorable (MStatus *ReturnStatus=NULL) const |
Returns true if this attribute is to be stored when the node is saved to a file. More... | |
bool | isCached (MStatus *ReturnStatus=NULL) const |
Returns true if this attribute is cached locally in the node's data block. More... | |
bool | isArray (MStatus *ReturnStatus=NULL) const |
Returns true if this attribute supports an array of data. More... | |
bool | indexMatters (MStatus *ReturnStatus=NULL) const |
Determines whether the user must specify an index when connecting to this attribute, or whether the next available index can be used. More... | |
bool | isKeyable (MStatus *ReturnStatus=NULL) const |
Returns true if this attribute is keyable. More... | |
bool | isChannelBoxFlagSet (MStatus *ReturnStatus=NULL) const |
Returns true if this attribute has its channel box flag set. More... | |
bool | isHidden (MStatus *ReturnStatus=NULL) const |
Returns true if this attribute is to hidden from the UI. More... | |
bool | isUsedAsColor (MStatus *ReturnStatus=NULL) const |
Returns true if this attribute is to be presented as a color in the UI. More... | |
bool | isIndeterminant (MStatus *ReturnStatus=NULL) const |
Returns true if this attribute is indeterminant. More... | |
bool | isRenderSource (MStatus *ReturnStatus=NULL) const |
Returns true if this attribute is a render source. More... | |
bool | isDynamic (MStatus *ReturnStatus=NULL) const |
Returns true if this attribute is a dynamic attribute. More... | |
bool | isExtension (MStatus *ReturnStatus=NULL) const |
Returns true if this attribute is an extension attribute. More... | |
bool | isWorldSpace (MStatus *ReturnStatus=NULL) const |
Returns true if this attribute is worldspace. More... | |
bool | isAffectsWorldSpace (MStatus *ReturnStatus=NULL) const |
Returns true if this attribute affects worldspace. More... | |
bool | isUsedAsFilename (MStatus *ReturnStatus=NULL) const |
Returns true if this attribute is to be used as a filename. More... | |
bool | affectsAppearance (MStatus *ReturnStatus=NULL) const |
Returns true if this attribute affects the appearance of the object when rendering in the viewport. More... | |
bool | isProxyAttribute (MStatus *ReturnStatus=NULL) const |
Returns true if this attribute is a proxy attribute. More... | |
DisconnectBehavior | disconnectBehavior (MStatus *ReturnStatus=NULL) const |
Returns the behavior of this attribute when it is disconnected. More... | |
bool | usesArrayDataBuilder (MStatus *ReturnStatus=NULL) const |
Returns true if this attribute uses an array data builder. More... | |
bool | internal (MStatus *ReturnStatus=NULL) const |
Returns true if a node has internal member data representing this attribute. More... | |
MStatus | setReadable (bool state) |
Sets whether this attribute should be readable. More... | |
MStatus | setWritable (bool state) |
Sets whether this attribute should be writable. More... | |
MStatus | setConnectable (bool state) |
Sets whether this attribute should allow dependency graph connections. More... | |
MStatus | setStorable (bool state) |
Sets whether this attribute should be storable. More... | |
MStatus | setCached (bool state) |
Sets whether the data for this attribute is cached locally in the node's data block. More... | |
MStatus | setArray (bool state) |
Sets whether this attribute should have an array of data. More... | |
MStatus | setIndexMatters (bool state) |
If the attribute is an array, then this method specifies whether to force the user to specify an index when connecting to this attribute, or to use the next available index. More... | |
MStatus | setKeyable (bool state) |
Sets whether this attribute should accept keyframe data. More... | |
MStatus | setChannelBox (bool state) |
Sets whether this attribute should appear in the channel box when the node is selected. More... | |
MStatus | setHidden (bool state) |
Sets whether this attribute should be hidden from the UI. More... | |
MStatus | setUsedAsColor (bool state) |
Sets whether this attribute should be presented as a color in the UI. More... | |
MStatus | setIndeterminant (bool state) |
Sets whether this attribute is indeterminant. More... | |
MStatus | setRenderSource (bool state) |
Sets whether this attribute should be used as a render source attribute. More... | |
MStatus | setWorldSpace (bool state) |
Sets whether this attribute should be treated as worldspace. More... | |
MStatus | setAffectsWorldSpace (bool state) |
Sets whether this attribute should affect worldspace. More... | |
MStatus | setUsedAsFilename (bool state) |
Sets whether this attribute should be presented as a filename in the UI. More... | |
MStatus | setAffectsAppearance (bool state) |
Sets whether this attribute affects the appearance of the object when rendering in the viewport. More... | |
MStatus | setProxyAttribute (bool state) |
Sets whether this attribute is a proxy attribute. More... | |
MStatus | setDisconnectBehavior (DisconnectBehavior behavior) |
Sets the disconnection behavior for this attribute. More... | |
MStatus | setUsesArrayDataBuilder (bool state) |
Sets whether this attribute uses an array data builder. More... | |
MStatus | setInternal (bool state) |
The function controls an attribute's data storage. More... | |
MStatus | setNiceNameOverride (const MString &localizedName) |
Sets the localized string which should be used for this attribute in the UI. More... | |
bool | acceptsAttribute (const MFnAttribute &attr, MStatus *ReturnStatus=NULL) const |
Returns true if this attribute can accept a connection with the given attribute. More... | |
bool | accepts (MFnData::Type type, MStatus *ReturnStatus=NULL) const |
Returns true if this attribute can accept a connection of the given type. More... | |
bool | accepts (const MTypeId &id, MStatus *ReturnStatus=NULL) const |
Returns true if this attribute can accept a connection of the given type. More... | |
MObject | parent (MStatus *ReturnStatus=NULL) const |
Get the parent of this attribute, if it has one. More... | |
MString | name (MStatus *ReturnStatus=NULL) const |
Returns the long name of the attribute. More... | |
MString | shortName (MStatus *ReturnStatus=NULL) const |
Returns the short name of the attribute. More... | |
MString | getAddAttrCmd (bool useLongName=false, MStatus *status=NULL) const |
Returns a string containing the addAttr command which would be required to recreate the attribute on a node. More... | |
MStatus | addToCategory (const MString &category) |
Add the attribute to the named category. More... | |
MStatus | removeFromCategory (const MString &category) |
Remove the attribute from the named category. More... | |
bool | hasCategory (const MString &category) const |
Check to see if the attribute belongs to the named category. More... | |
MStatus | getCategories (MStringArray &ReturnStatus) const |
Get all of the categories to which this attribute belongs. More... | |
MFnAttribute (const MObject &object, MStatus *ReturnStatus=NULL) | |
NO SCRIPT SUPPORT. More... | |
Public Member Functions inherited from MFnBase | |
virtual | ~MFnBase () |
Class Destructor. More... | |
bool | hasObj (MFn::Type) const |
Determines whether or not the Function Set is compatible with the specified Maya Object within the API RTTI system. More... | |
bool | hasObj (const MObject &) const |
Determines whether or not the Function Set is compatible with the specified Maya Object within the API RTTI system. More... | |
MObject | object (MStatus *ReturnStatus=NULL) const |
Returns the MObject that is attached to the Function Set. More... | |
virtual MStatus | setObject (MObject &object) |
Attaches the Function Set to the specified Maya Object. More... | |
virtual MStatus | setObject (const MObject &object) |
NO SCRIPT SUPPORT. More... | |
Protected Member Functions | |
virtual const char * | className () const |
Class name. More... | |
Additional Inherited Members | |
Public Types inherited from MFnAttribute | |
enum | DisconnectBehavior { kDelete, kReset, kNothing } |
Attribute behaviour on disconnect. More... | |
Static Public Member Functions inherited from MFnBase | |
static const char * | className () |
Returns the name of this class. More... | |
MFnCompoundAttribute | ( | MObject & | object, |
MStatus * | ReturnStatus = NULL |
||
) |
Constructor.
Class constructor that initializes the function set to the given MObject.
[in] | object | The MObject to attach the function set to |
[out] | ReturnStatus | the return status |
MFnCompoundAttribute | ( | const MObject & | object, |
MStatus * | ReturnStatus = NULL |
||
) |
NO SCRIPT SUPPORT.
Class constructor that initializes the function set to the given MObject.
Constructor
[in] | object | The MObject to attach the function set to |
[out] | ReturnStatus | the return status |
|
virtual |
Function set type.
Return the class type : MFn::kCompoundAttribute.
Reimplemented from MFnAttribute.
|
protectedvirtual |
Creates a new compound attribute.
The create method needs to be called on a per node basis. That means if you want to create and add the same attribute to multiple nodes, you need to call the create method for each node to get a unique MObject back. If you call create just once and add the attribute to multiple nodes, Maya will encounter a fatal error.
[in] | full | Long name of the attribute. |
[in] | brief | Short name of the attribute. |
[out] | ReturnStatus | Status code. |
Add a child attribute under this compound attribute.
[in] | child | new child attribute |
Remove a child attribute from this compound attribute.
[in] | child | child attribute to remove |
unsigned int numChildren | ( | MStatus * | ReturnStatus = NULL | ) | const |
Returns the number of child attributes that this compound attribute has.
[out] | ReturnStatus | return status |
Get a child of this compound attribute.
[in] | index | index of child |
[out] | ReturnStatus | return status |
MStatus getAddAttrCmds | ( | MStringArray & | cmds, |
bool | useLongNames = false |
||
) | const |
Returns a string array containing the addAttr commands which would be required to recreate the attribute and all of its descendents on a node.
The attributes are returned in depth-first order, meaning that element 0 of the array will contain this attribute's addAttr command, element 1 will contain the command for its first child, element 2 will contain the command for its first child's child, if one exists, and so on.
Each command is returned with the terminating semicolon and is formatted as if for use with a selected node, meaning that no node name is supplied.
[out] | cmds | string array to receive the adAttr commands |
[in] | useLongNames | if true, long attribute names are used rather than short |