doffer
09-20-2010, 08:58 PM
Hi guys.
Let me first apologize for my lack of knowledge.
I'm completere green when it comes to scripting but I really need to make a button that can reset my rig.
I'm gonna make a few buttons for selecting and keying all the controls which is easy enough, but now I want to be able to reset the rig into default pose.
I thought I could just use the selection I already know how to do, and use the selection to set the rotate and translate values to zero on all controls at the same time, without hard coding the names individually.
I did a quick test and thought this would do the trick:
string $selection[] = `ls -sl`;
setAttr "$selection[].rx" 0;
setAttr "$selection[].ry" 0;
setAttr "$selection[].rz" 0;
No such luck.
I get a
"// Error: string $selection[] = `ls -sl`;
//
// Error: Invalid redeclaration of variable "$selection" as a different type. // "
Can someone lead me in the right direction?
How do I set the rotational and translational values across a number of selected controls?
Cheers :)
Let me first apologize for my lack of knowledge.
I'm completere green when it comes to scripting but I really need to make a button that can reset my rig.
I'm gonna make a few buttons for selecting and keying all the controls which is easy enough, but now I want to be able to reset the rig into default pose.
I thought I could just use the selection I already know how to do, and use the selection to set the rotate and translate values to zero on all controls at the same time, without hard coding the names individually.
I did a quick test and thought this would do the trick:
string $selection[] = `ls -sl`;
setAttr "$selection[].rx" 0;
setAttr "$selection[].ry" 0;
setAttr "$selection[].rz" 0;
No such luck.
I get a
"// Error: string $selection[] = `ls -sl`;
//
// Error: Invalid redeclaration of variable "$selection" as a different type. // "
Can someone lead me in the right direction?
How do I set the rotational and translational values across a number of selected controls?
Cheers :)
