PDA

View Full Version : Looking for Max IK/FK switch tutorial


Maxim_311
05-20-2006, 07:56 AM
I'm looking for a max tutorial/walkthrough that will help me create a IK/FK arm like that on the Low Max rig, which besides having the ik/fk switch has the nifty match FK>IK and match IK>FK buttons. Again, any help information wise or pointing me in the right direction would be great. I haven't been able to find anything like what I'm looking for. thanks.

eek
05-22-2006, 01:35 AM
ok, ill find you it. I posted it here somewhere:

Fk/IK Blended method:

I will just use bones for this, you could add shape controllers and advise you do to hold the sliders and buttons etc.
Step 0:

In the top viewport create a helpers>point object name it "root".

Step 1:

In the top Viewport build a fk arm chain including the upper arm, lower arm and hand. With the names:

"fk_upper"
"fk_lower"
"fk_hand"

Make a helpers>point object, calling it "fk_lookat" select it and assign it a animation>constraints>position constraint and select the "fk_upper" bone.
Select the "fk_lookat" point object again and go into the motion>position>position>position constraint rollout press 'Add Position Target' and press the "fk_hand" bone.
Select the "fk_lookat" point object gain and assign it a animation>constraints>lookAt constraint. Select the "fk_lower" bone.


Create a new helpers>point object, show parameters rollout>display>box checked. Name it "fk_swivel" and align it both positionally and orientationally to the "fk_lookat" .
Select the "fk_swivel" point,change the 'reference coardynates' to 'local mode' and in 'move mode' move along the x axis the point away from the elbow. Link the "fk_swivel"
point object to the "fk_lookat" point object.


Step 2:

Copy this chain with the names:

"def_upper"
"def_lower"
"def_hand"

move it slightly down.


Step 3:

Copy this chain with the names:

"ik_upper"
"ik_lower"
"ik_hand"

Move it slightly down.

Run an 'HI' (history independant) iksolver from the "ik_upper" to the 'ik_hand" bones, call it "ik_control" .

Create a helpers>point object and place it away from the elbow. Call it "ik_swivel"

Select the ik handle (the blue cross at "ik_hand" ) and go into the motion panel>IK Solver Properties rollout>Ik solver Plane.
Click the 'None' button below 'pick target:' and select the "ik swivel" point object.

create a helpers>point object with the name "ik_hand_control" show>display box checked. Select the "ik_hand_control", in the heirachy>pivot>adjust pivot rollout press 'align to world'. Align the "ik_hand_control" point object to the "ik_hand" bone both positional and orientationally.

Select the "ik_control" handle and assign it a animation>constraints>position constraint, select the "ik_hand_control" point object.
Select the "ik_hand" bone and assign it a animation>constraints>orientation constraint, select the "ik_hand_control" point object.


Step 4:

Select the "def_upper" bone and assign it an animation>constraints>orientation constraint. Select the "fk_upper" bone. Select the "def_upper"
bone again and in the motion>rotation>orientation constraint rollout press 'Add orientation target' and select the "ik_upper" bone.

Select the "def_lower" bone and assign it an animation>constraints>orientation constraint. Select the "fk_lower" bone. Select the "def_lower"
bone again and in the motion>rotation>orientation constraint rollout press 'Add orientation target' and select the "ik_lower" bone.


Select the "def_hand" bone and assign it an animation>constraints>orientation constraint. Select the "fk_hand" bone. Select the "def_hand"
bone again and in the motion>rotation>orientation constraint rollout press 'Add orientation target' and select the "ik_hand" bone.


Step 5:

Select the "def_hand" bone, in the modifiers panel>modifiers list assign a 'Attribute Holder'. Select the "def_hand" bone again and open a new
maxscript>new script. Evaluate this code:


ikfk_ca = attributes ikfk_attribs
(
parameters ikfk_params rollout: ikfk_roll
(
'ikfk_blend' type:#float ui:ikfk_slider animatable:true
)
rollout ikfk_roll "IK-FK Options"
(
slider ikfk_slider "IK-FK Blend:" range:[0,100,0] ticks:0

group "Snap:"
(
button snap_fk "FK to IK" across:2 width: 65
button snap_ik "IK to FK" width: 65
)
on snap_fk pressed do
(
$fk_upper.transform = $ik_upper.transform
$fk_lower.transform = $ik_lower.transform
$fk_hand.transform = $ik_hand.transform
)

on snap_ik pressed do
(
$ik_hand_control.pos = $fk_hand.pos
$ik_swivel.pos = $fk_swivel.pos
)
)
)

custAttributes.add $def_hand.modifiers[1] ikfk_ca



Step 6:
Select the "def_upper" bone and go to animation>wire parameters...>transform>rotation>orientation constraint>orientation weight 0 then
select the "def_hand" bone and go to modifed objects>Attibute Holder>ikfk_attribs>ikfk_blend.

In the bottom left window type:

"100-ikfk_blend" then press the '<---' button and 'connect'.

In the top left window select the 'orientation weight 1' and in the bottom left window type:

"ikfk_blend" then press the '<---' button and 'connect' and close the window.


Select the "def_lower" bone and go to animation>wire parameters...>transform>rotation>orientation constraint>orientation weight 0 then
select the "def_hand" bone and go to modifed objects>Attibute Holder>ikfk_attribs>ikfk_blend.

In the bottom left window type:

"100-ikfk_blend" then press the '<---' button and 'connect'.

In the top left window select the 'orientation weight 1' and in the bottom left window type:

"ikfk_blend" then press the '<---' button and 'connect' and close the window.


Select the "def_hand" bone and go to animation>wire parameters...>transform>rotation>orientation constraint>orientation weight 0 then
select the "def_hand" bone and go to modifed objects>Attibute Holder>ikfk_attribs>ikfk_blend.

In the bottom left window type:

"100-ikfk_blend" then press the '<---' button and 'connect'.

In the top left window select the 'orientation weight 1' and in the bottom left window type:

"ikfk_blend" then press the '<---' button and 'connect' and close the window.


Step 7:

Parent the "fk_upper","def_upper" and "ik_upper" bones to the "root" point object.
Align these three to the "root" point positionally. Align the "ik_swivel" point to the "fk_swivel" point positionally.


Also this is in no way a an advanced setup, its just here to help you get off the start post.


http://forums.cgsociety.org/showthread.php?t=323276&page=1&pp=15&highlight=ik%2Ffk

cheers,

Maxim_311
05-22-2006, 02:06 AM
Thanks eek. For some reason I didn't find that previous thread when I did a search. Thanks again.

CGTalk Moderation
05-22-2006, 02:06 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.