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):
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.
I even tried it with a few other data types (strings, etc), and those are also Attribute Editor friendly. Tried force setting the readable and writable flags too just for grins, but yeah no dice…Might be worth bouncing off of Autodesk?
Thanks for the assistance. You guys put the awesome in TA.org. :):
Floats do indeed seem to be better behaved than doubles, and for my purposes, floats will do just fine. That said, I’m still running into some odd behavior. The edit boxes are visible (as desired), but I’m noticing that the “display name” of the float3 attribute gets replaced with name of its parent (that is, the compound object) when I deselect and then re-select the node. I say “display name” because I can still get/set the “sub” float attributes using the float3 attribute’s “actual” name. Just for additional clarity I’ve added some images below using the follow code as provided by Seth: