Hi,
First of all, I'm using Maya 2016 Ext2 student edition. Recently I started a GUI window for my plugin (an exporter to a video game format). It's used to define animation sequences and it involves choosing a "type" in a fixed set (Stand, Run, Walk..).
Screenshot : https://i.imgur.com/Ut7DlCQ.png
It works perfectly except the attrEnumOptionMenu. It's suppose to access an array attribute with an index (I give the good full attribute name in the for loop) but it always use -1. All the other attributes work great.
The code :
Bugged attrEnumOptionMenu
int $nbAnimClips = size($gM2EditorCurrentNode) ? `getAttr -size ($gM2EditorCurrentNode + ".animClips")` : 0;
// Each line is its own formLayout
for( $i=0; $i < $nbAnimClips; $i++)
{
string $formLayoutClip = `formLayout -width 100`;
<Skipped code>
string $typeAttr = ($gM2EditorCurrentNode + ".animClips[" + $i + "].animClipType");
print ("Line " +$i+ ": typeAttr " + $typeAttr + "\n");//For Debug
attrEnumOptionMenu -attribute $typeAttr
-annotation "Action that triggers the sequence"
animType;
<Skipped code>
int $top = ($i ? 5 : 2);
formLayout -edit
<Skipped code>
-attachControl endTime "right" 2 animType
-attachForm animType "top" $top
-attachControl animType "right" 18 loopingFlag
<Skipped code>
$formLayoutClip;
setParent ..;
}
As a result, anytime I change the value in the option menu I get a red "Error: Unable to resolve attribute 'EditorNode1.clips[-1].act'. Make sure specified attributes are valid."
Any idea why this behavior could happen ? And how to fix it ?
OptionMenu with connectControl does not work (blank menu).