Hi everyone! Right now for fun (and to learn more about MEL) I’ve started to make a rig generator for UDK vehicles where you place controllers at the points you want axles to be and it generates a bone structure from that.
Not as much a problem as just a question, is there a way to add objects to an array as they are created so that instead of having the user select all the control curves it will just select all the created curves.
An example of this being that when it creates a Control_Axel it adds it to an array that I can access later. Thanks in advance.
window -title "Vehicle Rig" -widthHeight 200 100 myWindow;
//Button Layout
columnLayout -adjustableColumn true;
button -label "Make Root" -command createRoot;
button -label "Make Axel" -command createAxle;
button -label "Make Bones" -command createBone;
//Creates controller named Control_Root
proc createRoot() {
circle -n Root_Controller -ch on -nr 0 1 0 -r 10;
}
//Creates controller named Control_Axle
proc createAxle() {
circle -n Control_Axel -ch on -nr 0 1 0 -r 10;
}
//Gets position of controllers selected and adds joints
proc createBone() {
$Controls = `ls -sl`;
select -cl;
for ( $item in $Controls ) {
$POS = `xform -q -t $item`;
$NJ = `joint -p $POS[0] $POS[1] $POS[2]`;
pickWalk -d up;
}
}
showWindow myWindow;