PDA

View Full Version : forearm setup?


nemirc
07-28-2003, 05:09 AM
Hello everybody!

I was trying to come up with a way to solve the "candy-wrap" effect of forearm setup (during twist) by using some sort of double-bone setup, but because of the forearm's shape (conical?) that unwanted effect is still visible (a little, but it's there).

Does anyone have a better way to setup forearms? I am actually trying to replicate the twist effect in which the "root" remains in position but the twisting deformation increases gradually to the top (wrist)

Thanks :beer:

loked
07-28-2003, 09:09 AM
Jason Schleifer's DVD has a really nice forearm twist that basically replicates the bone structure in your arm. You might want to check that out if you have access to the DVD.

Another suggestion would be to actually go and model the bones and muscle and with clusters and driven keys, get them to twist exactly like a normal forearm would. Then use the bones and muscles as influences. If you want even more realism, you can then also create a blend shape just to refine it a bit and drive that as well with SDK's.

Hope this helps :thumbsup:


later:wavey:
loked

pauldryzen
07-28-2003, 04:06 PM
Hi Nemirc,

if written a script for exact this problem.

You can give it a try.

But you must orient your joints in "Y" for the script!


here is the script, just copy all the stuff to a shelf button and it should work fine.

after running the script, connect the wrist rotation to the new extra attribute (inRotateY) of your lowerarm joint...


Hope this helps

after running the script, connect the wrist roation to the extra attribute of your lowerarm joint...

// build new joints script (c) Paul Dreisen 2003
// mailto: pauldryzen@web.de
// Version 0.2
/* This scripts builds new joints from the selected joint to its first child.

I use this script for character setup (upper arm, lower arm, upper leg...).



how to: First, drag the whole script to your shelf and press the new button, if everything is right... you should see a new window :-)
Now select the joint, type the new name in the empty textfield of the window.
Choose the number of joints
Now press the "GO" button and see what happens ;-)

LIMITATIONS: you cannot choose the the orientation axis (the default is: YXZ), should be added in the next version

History: V0.1: first version
V0.2: fixed the number of joints problem, added an extraAttribute (inRotateY) to the selected joint, for more flexibility during the setup process.
(see comment lines for more information)

*/

// start of Script


if ( `window -exists jointMaker` )
deleteUI -window jointMaker;


window -title "add Joints UI" -wh 320 104 -sizeable 0 jointMaker;
$form = `formLayout -nd 100`;

$col = `columnLayout -adj true`;
textFieldGrp -label "Enter new joint name" -cw 2 160 jointName; intFieldGrp -nf 1 -label "how many Joints?" -v1 8 joints;
setParent $form;
$b1 = `button -label "Go" -command "addJointsCallback"`;
$b2 = `button -label "Close" -command "deleteUI jointMaker"`;

formLayout -edit
-attachForm $col "top" 5
-attachForm $col "left" 5
-attachForm $col "right" 5
-attachNone $col "bottom"

-attachNone $b1 "top"
-attachForm $b1 "left" 5
-attachPosition $b1 "right" 2 50
-attachForm $b1 "bottom" 5

-attachNone $b2 "top"
-attachPosition $b2 "left" 2 50
-attachForm $b2 "right" 5
-attachForm $b2 "bottom" 5
$form;

showWindow jointMaker;


global proc addJointsCallback()

{
string $jointName = `textFieldGrp -q -text jointName`; int $number = `intFieldGrp -q -v1 joints`;
string $sel[0] = `ls -sl`;
string $child[0];
string $nJoint[];

// add an extra attribute to the selected joint and connect the rotateY to the attribute (inRotateY).
// If you have an Ik-setup you can connect anything to the new attribute without having the problem that the rotations are locked

addAttr -ln inRotateY -at double -keyable true $sel;
connectAttr -f ($sel[0] +".rotateY") ($sel[0] +".inRotateY");


float $n3;
// this lists the child of the joint

$child = `listRelatives -c $sel[0]`;

// get worldPosition of the two joints

float $cvpos1[] = `xform -q -a -t -ws $sel[0]`;

float $cvpos2[] = `xform -q -a -t -ws $child[0]`;


// create the needed multiplyDivide nodes

string $multi = `shadingNode -au multiplyDivide`;
string $multi2 = `shadingNode -au multiplyDivide`;
string $multi3 = `shadingNode -au multiplyDivide`;

// settings for nodes

setAttr ($multi + ".input2Y") -1;
setAttr ($multi + ".operation") 1;

// fixed setting for the rotation divide node

setAttr ($multi2 + ".input2Y") ($number -1);
setAttr ($multi2 + ".operation") 2;
setAttr ($multi3 + ".input1Y") 1;
setAttr ($multi3 + ".input2Y") $number;
setAttr ($multi3 + ".operation") 2;


float $n3 = `getAttr ($multi3 + ".outputY")`;




// make connections
connectAttr -f ($sel[0] +".inRotateY") ($multi +".input1Y");
connectAttr -f ($sel[0] +".inRotateY") ($multi2 +".input1Y");

// create a curve to have control over the position of the new joints

string $baseCurve = `curve -d 1 -p $cvpos1[0] $cvpos1[1] $cvpos1[2] -p $cvpos2[0] $cvpos2[1] $cvpos2[2] -k 0 -k 1` ;



// create the additional joints

for ($i=0;$i<$number+1;$i++)
{

// V0.2 added this varible to have control over the curveParamter, sometimes it needs to be clamped to the value 1

float $cpara = (0 +(($n3 * ($i))));



if ($cpara<1)
{
float $posi[]=`pointOnCurve -pr $cpara -p $baseCurve`;
$nJoint[$i] = `joint -p $posi[0] $posi[1] $posi[2] -n ($jointName+"BIND_"+$i)`;
}
else // if the $cpara value is more than 1, Maya cannot query the world position and prints out 0 0 0,
// to fix this I just enter the value 1 into the $posi[] and everything works fine.
{
float $posi[]=`pointOnCurve -pr 1 -p $baseCurve`;
$nJoint[$i] = `joint -p $posi[0] $posi[1] $posi[2] -n ($jointName+"BIND_"+$i)`;

}

if ($i>0 && $i<$number+1)
{
//orient the joints (because they only get rotations in y we donīt need to take care for the x and z axis
joint -e -zso -oj yxz $nJoint[$i-1];

}
if ($i>0 && $i<$number)
{

// this connects all the new joints to the $multi2 node
connectAttr -f ($multi2 +".outputY") ($nJoint[$i] +".rotateY");
}


}


// at last connect $sel[0] rotateY to $nJoint[0], to remove the rotation in Y

connectAttr -f ($multi +".outputY") ($nJoint[0] +".rotateY");

// now parent the new joints to the selected Joint and delete the unused nodes

select $nJoint[0];
select -tgl $sel[0];
parent;
delete $baseCurve;
delete $multi3;



}


// end of script

nemirc
07-28-2003, 04:14 PM
Holly..... :surprised

I'll give it a try right away and post the result.
Thanks :buttrock:

nemirc
07-30-2003, 05:43 AM
I tried the script and works nicely. That's something like my forearm setup (without the mel coding and stuff) but I was only using two bones (I used four, in this case). :D

BTW, are you one of the guys that worked on Dronez? :applause:

pauldryzen
07-30-2003, 07:54 AM
Yeah,

but I did only a few things, the main thing was the whole corridor scene, some additional animations and particle simulations (glas and fire)...


greetz Paul

dmcgrath
08-02-2003, 06:55 AM
Another way to help cure your problem is to model the forearm correctly. I am not slamming you, but I often see people with a mesh that goes straight down the arm. If you model in the "twist", then it will untwist when you rotate the arm.

nemirc
08-02-2003, 03:05 PM
Originally posted by dmcgrath
Another way to help cure your problem is to model the forearm correctly. I am not slamming you, but I often see people with a mesh that goes straight down the arm. If you model in the "twist", then it will untwist when you rotate the arm.

I see, modeling a "twisted forearm" ou say.
I'll keep that in mind, but for this case, I didn't model the character, only rigged it :rolleyes:

dmcgrath
08-02-2003, 10:17 PM
Yeah, I had a modeling teacher that was really adamant about creating muscles and bones the way it would most work for the final animations. He had all kinds of things to show us as far as that goes. I guess you didn't have the luxury, as that often happens. Glad you could work it out though.

CGTalk Moderation
01-15-2006, 06:00 PM
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.