# MFnCompoundAttribute

## Base Class

MFnAttribute

## Constants

None.

## Static Methods

None.

## Static Attributes

None.

## Constructors

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

## Object Methods

Signature | Parameters | Returns | Description
--- | --- | --- | ---
addChild(child) | child - MObject | Reference to self. | Add a child attribute.
child(index) | index - int | MObject | Returns the index'th child attribute of this compound.
create(longName, shortName) | longName - string shortName - string | MObject | Create a new compound attribute with the given longName and shortName, attach it to the function set and return it in an MObject.
getAddAttrCmds(longNames=False) | longNames - bool | list of strings | Returns a list of strings containing the addAttr commands necessary to recreate the compound attribute and all of its children. 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.
numChildren() |  | int | Returns number of child attributes currently parented under this compound attribute.
removeChild(child) | child - MObject | Reference to self. | Remove a child attribute.

## Object Attributes

None.

## Sequence Support

None.

## Number Support

None.

## Comparison Support

None.

© 2011 Autodesk, Inc. All rights reserved.