Hello All,
I have a script that generates buttons for an interface. In here, the buttons execute ( see code at $button_cmd1 ) a command that needs to be driven by the user selection after the interface have been created. I'm calling a procedure to take care of the issue but the execution of the procedure would make Maya crash. Please help with any information or let me know if my syntax is just wrong:
CODE
// procedure to get user's selection
global proc GetAzimuthPath()
{
string $mySectionSelection = textFieldGrp -query -text txtFldGrp\_setsecDir
;
$mySectionSelection = substitute "PN\_" $mySectionSelection ""
;
global string $CtrlFinalList2[]; // created at the top.
for ( $myCtrl in $CtrlFinalList2 )
{
print ("control : " + $myCtrl + "\n");
print ("selection: " + $mySectionSelection + "\n");
if ( gmatch $mySectionSelection "ZooSection\_B"
&& gmatch $myCtrl "*ZooSection\_B*"
)
{
print ("match 1: " + $myCtrl + "\n");
break;
}
if ( gmatch $mySectionSelection "ZooSection\_F"
&& gmatch $myCtrl "*ZooSection\_F*"
)
{
print ("match 2: " + $myCtrl + "\n");
break;
}
}
$PresetNode = $myCtrl;
string $PresetCmdName = ($PresetNode + ".Azimuth");
print $PresetCmdName;
}
// procedure to create interface
proc CreateInterface()
{
$button_cmd1 = "setAttr " + GetAzimuthPath() + " 290";
$button_cmd2 = "setAttr " + GetAzimuthPath() + " 340";
$button_cmd3 = "setAttr " + GetAzimuthPath() + " 20";
}
Thanks for any information.