PDA

View Full Version : Hand Rigging Script errors


Apophis3d
01-26-2008, 11:56 PM
Ok Ive been trying to setup this script for rigging a hand controler. However I am running into errors when running it's values though a multiply and divide node, inorder to get the hand splay function to work right. The node does not seem to be calculating the values correctly.

But even before I get to that I get an error when trying to connect the middle finger it tells me it does not exist.... But it does....

// Error: The destination attribute 'L_Middle.rotateY' cannot be found. //

Maybe ive been fighting this thing to long and am over looking the error in the code.

global proc hand()
{
//Creates Multiply / Divide Node
shadingNode -asUtility multiplyDivide;
// Multiply Node Splay Values
setAttr "multiplyDivide1.input2X" -1;
setAttr "multiplyDivide1.input2Y" -0.3;
setAttr "multiplyDivide1.input2Z" 0.3;
rename "multiplyDivide1" "L_Finger_Splay";
//CreateNURBSCircle;
circle -c 0 0 0 -nr 0 1 0 -sw 360 -r 1 -d 3 -ut 0 -tol 0.01 -s 8 -ch 1;
setAttr -lock true -keyable false "nurbsCircle1.tx";
setAttr -lock true -keyable false "nurbsCircle1.ty";
setAttr -lock true -keyable false "nurbsCircle1.tz";
setAttr -lock true -keyable false "nurbsCircle1.rx";
setAttr -lock true -keyable false "nurbsCircle1.ry";
setAttr -lock true -keyable false "nurbsCircle1.rz";
setAttr -lock true -keyable false "nurbsCircle1.sx";
setAttr -lock true -keyable false "nurbsCircle1.sy";
setAttr -lock true -keyable false "nurbsCircle1.sz";
setAttr -lock true -keyable false "nurbsCircle1.v";
rename "nurbsCircle1" "finger_controler";
//Adds Pinky Attributes
addAttr -ln "pinky_01" -at double |finger_controler;
setAttr -e-keyable true |finger_controler.pinky_01;
addAttr -ln "pinky_02" -at double |finger_controler;
setAttr -e-keyable true |finger_controler.pinky_02;
addAttr -ln "pinky_03" -at double |finger_controler;
setAttr -e-keyable true |finger_controler.pinky_03;
//Connects Pinkys
connectAttr -f finger_controler.pinky_01 L_Pinky1.rotateZ;
connectAttr -f finger_controler.pinky_02 L_Pinky2.rotateZ;
connectAttr -f finger_controler.pinky_03 L_Pinky3.rotateZ;
// Adds Ring Finger Controls
addAttr -ln "ring_01" -at double |finger_controler;
setAttr -e-keyable true |finger_controler.ring_01;
addAttr -ln "ring_02" -at double |finger_controler;
setAttr -e-keyable true |finger_controler.ring_02;
addAttr -ln "ring_03" -at double |finger_controler;
setAttr -e-keyable true |finger_controler.ring_03;
//Connects Ring Finger
connectAttr -f finger_controler.ring_01 L_Ring1.rotateZ;
connectAttr -f finger_controler.ring_02 L_Ring2.rotateZ;
connectAttr -f finger_controler.ring_03 L_Ring3.rotateZ;
// Adds Middle Finger Controls
addAttr -ln "middle_01" -at double |finger_controler;
setAttr -e-keyable true |finger_controler.middle_01;
addAttr -ln "middle_02" -at double |finger_controler;
setAttr -e-keyable true |finger_controler.middle_02;
addAttr -ln "middle_03" -at double |finger_controler;
setAttr -e-keyable true |finger_controler.middle_03;
//Connects Middle Finger
connectAttr -f finger_controler.middle_01 L_Middle1.rotateZ;
connectAttr -f finger_controler.middle_02 L_Middle2.rotateZ;
connectAttr -f finger_controler.middle_03 L_Middle3.rotateZ;
// Adds Index Finger Controls
addAttr -ln "index_01" -at double |finger_controler;
setAttr -e-keyable true |finger_controler.index_01;
addAttr -ln "index_02" -at double |finger_controler;
setAttr -e-keyable true |finger_controler.index_02;
addAttr -ln "index_03" -at double |finger_controler;
setAttr -e-keyable true |finger_controler.index_03;
//Connects index Finger
connectAttr -f finger_controler.index_01 L_Index1.rotateZ;
connectAttr -f finger_controler.index_02 L_Index2.rotateZ;
connectAttr -f finger_controler.index_03 L_Index3.rotateZ;
// Adds Thumb Finger Controls
addAttr -ln "thumb_01" -at double |finger_controler;
setAttr -e-keyable true |finger_controler.thumb_01;
addAttr -ln "thumb_02" -at double |finger_controler;
setAttr -e-keyable true |finger_controler.thumb_02;
//Connects Middle Finger
connectAttr -f finger_controler.thumb_01 L_Thumb1.rotateY;
connectAttr -f finger_controler.thumb_02 L_Thumb2.rotateY;
//Spacer
addAttr -ln "________________________________________" -at double |finger_controler;
setAttr -e-keyable true |finger_controler.________________________________________;
//Adds Splay Controls
addAttr -ln "PinkySplay" -at double |finger_controler;
setAttr -e-keyable true |finger_controler.PinkySplay;
addAttr -ln "RingSplay" -at double |finger_controler;
setAttr -e-keyable true |finger_controler.RingSplay;
addAttr -ln "MiddleSplay" -at double |finger_controler;
setAttr -e-keyable true |finger_controler.MiddleSplay;
addAttr -ln "IndexSplay" -at double |finger_controler;
setAttr -e-keyable true |finger_controler.IndexSplay;
addAttr -ln "ThumbSplay" -at double |finger_controler;
setAttr -e-keyable true |finger_controler.ThumbSplay;
//Connects Splay Conrols
connectAttr -f finger_controler.PinkySplay L_Finger_Splay.input1X;
connectAttr -f finger_controler.PinkySplay L_Finger_Splay.input1Y;
connectAttr -f finger_controler.PinkySplay L_Finger_Splay.input1Z;
connectAttr -f L_Finger_Splay.outputY L_Pinky1.rotateY;
//Index Splay
connectAttr -force finger_controler.IndexSplay L_Finger_Splay.input1X;
connectAttr -force L_Finger_Splay.outputY L_Index1.rotateY;
connectAttr -force L_Finger_Splay.outputZ L_Index1.rotateY;
//Ring Splay
connectAttr -force finger_controler.RingSplay L_Finger_Splay.input1X;
connectAttr -force finger_controler.RingSplay L_Finger_Splay.input1Y;
connectAttr -force finger_controler.RingSplay L_Finger_Splay.input1Z;
connectAttr -force L_Finger_Splay.outputY L_Ring1.rotateY;
//Middle Splay
connectAttr -force finger_controler.MiddleSplay L_Finger_Splay.input1X;
connectAttr -force L_Finger_Splay.outputY L_Middle.rotateY;
connectAttr -force L_Finger_Splay.outputZ L_Middle.rotateY;
}

cmogk
01-27-2008, 02:13 AM
line numbers might help narrow things down. I notice in the last 2 lines you're connecting to rotateY twice:

connectAttr -force L_Finger_Splay.outputY L_Middle.rotateY;
connectAttr -force L_Finger_Splay.outputZ L_Middle.rotateY;

Apophis3d
01-27-2008, 03:27 AM
hmm that might be it ill change that and see what happens

CGTalk Moderation
01-27-2008, 03:27 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.