nottoshabi
03-10-2011, 04:05 AM
I'm trying to group a joint and set the world position of that joint to the group so I can have 0 on translates and rotates. I can query the joint translate I just can not set it to the group. This is what I got so far, but I'm getting an error.
// Error: setAttr: Error reading data element number 1: //
I know is from this line ( setAttr ($Grp[0] + ".translate") $pos; )
//grp
string $Grp[] = `ls-sl`;
//jnt
string $Jnt[] = `ls-sl`;
//Get translate of joint
float $pos[] = `xform -q -ws -t $Jnt[0]`;
//setAttr to grp
setAttr ($Grp[0] + ".translate") $pos;
//reset joint to 0 0 0
setAttr ($Jnt[0] + ".translate")0 0 0;
// Error: setAttr: Error reading data element number 1: //
I know is from this line ( setAttr ($Grp[0] + ".translate") $pos; )
//grp
string $Grp[] = `ls-sl`;
//jnt
string $Jnt[] = `ls-sl`;
//Get translate of joint
float $pos[] = `xform -q -ws -t $Jnt[0]`;
//setAttr to grp
setAttr ($Grp[0] + ".translate") $pos;
//reset joint to 0 0 0
setAttr ($Jnt[0] + ".translate")0 0 0;
