I’m attempting to create a set of custom attributes on a node within Maya as a means to store configuration data for a tool I’m developing. For one of these custom attributes, I’d like to replicate what one sees with the translateX attribute of the “Transform Attributes” attribute group found ubiquitously on nodes within Maya (i.e., a float3 attribute with visible edit boxes that is a child of a compound attribute).
The following code works as expected (it results in 3 editable number fields being displayed in the Attribute Editor):
cmds.addAttr( longName='sanders', attributeType='double3' )
cmds.addAttr( longName='bess', attributeType='double', parent='sanders' )
cmds.addAttr( longName='les', attributeType='double', parent='sanders' )
cmds.addAttr( longName='wes', attributeType='double', parent='sanders' )
However if I try to nest the above float3 attribute as a child of a compound attribute as follows, problems ensue. I can still get/set the float3’s sub values, but the values themselves (i.e., the edit boxes) are no longer displayed in the Attribute Editor.
cmds.addAttr( longName='sampson', numberOfChildren=1, attributeType='compound' )
cmds.addAttr( longName='sanders', attributeType='double3', parent='sampson' )
cmds.addAttr( longName='bess', attributeType='double', parent='sanders' )
cmds.addAttr( longName='les', attributeType='double', parent='sanders' )
cmds.addAttr( longName='wes', attributeType='double', parent='sanders' )
If possible, I’d prefer to display this information to allow artists to conveniently view and edit these values.