I'm having trouble setting the value for an attribute I've added to shaders through a mel script. This attribute shows up in the AttributeEditor in a collapsable menu, and can be set manually by the user. A string is used for this attribute which is set by the user with a text field.
To set that attribute in a MEL script, this command is used:
setAttr ( $shader + ".myAttribute" ) "flippitygoo";
This results in an error: No object matches name: shader.myAttribute //
Looking into the problem, I've found that listAttr $shader
won't even show that ".myAttribute" is a part of the shader until the user expands the collapsable menu that has the attribute in the AttributeEditor. I am having trouble figure out if the attribute is being added too late, and I'm trying to open the AttributeEditor and then expand the collapsable menu just as the user would. I have not been able to found out how to do that. I've looked at these commands to try and fiddle with the collapsable menu:
attributeInfo
attributeMenu
editor
editorTemplate
textFieldGrp
So in the end, my question is: How can I expand a collapsable menu in the AttributeEditor through MEL?
Any insight on this problem would be greatly appreciated, even if the answer is "you can't do that."