Hi all,
Got an odd problem here when editing the -attribute flag on a gradientControl. According to the docs you can’t even change the attribute once the control is created, but I do it all the time and works fine - until now.
If I have a node with a ‘standard’ ramp-compatible compound attribute (in my case I used the MRampAttribute wrapper), changing the attribute after creation works as expected. However my ramp compound attribute is a part of a larger compound attribute which is also an array, so I would set it like this for example:
gradientControl -e -at myNode.arrayAttr[0].graphAttr
But Maya won’t let me assign it properly, nor does it throw an error message. If I assign it and then query the attribute property of the control, it returns nothing. But if I click on the graph control in the UI, it throws an error, using the example above, like this:
// Error: No object matches name: |transform1|myNode.arrayAttr[-1].graphAttr[0].graphAttr_FloatValue
Which is really weird because when I queried the attribute property of the control it returned nothing, but the error clearly showed it has saved the attribute just not the array index. Wrapping the attribute input in quotation marks doesn’t change it either.
The other simpler (non-compound) attributes in this array compound attribute behave as expected, so I don’t know whether it’s the gradientControl screwing up or having the ramp attribute inside an array compound attribute (or both) that’s making Maya mad.
By the way, this is being done in the context of a -callCustom in an AETemplate. I’d be happy with simply deleting the control and rebuilding it, but I don’t know how to insert it into the layout in it’s old position.
Any suggestions?