PDA

View Full Version : Is this a possible 3dsmax fk/ik seamless arm solution..?


Snape
11-21-2006, 10:58 AM
Hello all,

I have been working for some time now on the possiblity of creating an fk/ik arm rig with only one bone chain.

Although I havent finished (and for all I know I never will) at least I have finally found a way to control the arm in the viewport via the hand control and both upper and lower arm controls.

My script doesnt take care of adding keyframes yet so it wont animate properly if you try although some of my previous tests did seem to indicate it should.

I know from relentlessly searching cgtalk that lots of people would like a solution, and I know from my own animation experience that it would make life a lot easier. I also know there is a high possiblilty that my approach has been attempted by many far more experienced 3D artists than me.

So if you are interested please download my scene, open it and run this script and see what you think (and if youve seen it all before, maybe save me some time and put me out of my misery):


------------------------

deleteAllChangeHandlers()
when select $Hand_control changes do

(

if $==$Hand_control do

(

select $IK_Chain01

max unlink $

$Hand_control.pos=$IK_Chain01.pos

$IK_Chain01.parent = $Hand_control

$IK_Chain01.controller.enabled=1

select $Hand_control

)

)





when select $Circle01 changes do

(

if $==$Circle01 do

(

select $IK_Chain01

IKChainControl.action.setPrefAngles ()

$.controller.enabled=0

IKChainControl.action.assumePrefAngles ()

select $Circle01

)

)



when select $Circle02 changes do

(

if $==$Circle02 do

(

select $IK_Chain01

IKChainControl.action.setPrefAngles ()

$.controller.enabled=0

IKChainControl.action.assumePrefAngles ()

select $Circle02

)

)

--------------------------------

Thanks for looking.

Spencer

PEN
11-23-2006, 06:03 PM
Interesting and I haven't really tried it that way before. However your solution so far isn't really animation friendly at all. Just try it and you will see what I mean. It creates keys all over the place that don't keep in time with each other as you adjust the timming of the scene. Because it is controlled with the IK/FK switch there is no blend so it just snaps from one solution to another. This isn't a good thing to have happen. Animators like to make sure that they transition from one method to another is smooth.

I look forward to seeing if you can work out some of the issues with what you have done. Good work and keep it up.

Snape
11-23-2006, 07:58 PM
Hey thanks Paul!

I will try to work it out further and exhaust the possibility for use in animation.

Kind Regards

Spencer Carpenter

Snape
11-26-2006, 08:50 PM
Although its nowhere near finished, I finally feel I have got somewhere further with this.

You can now animate the test arm using just the hand control, upper and lower arm handles and fk/ik switch.

At the moment it will break very easily and you really need to follow these steps to ensure you can see the principle of it working:

First of all run this script:

deleteAllChangeHandlers()

when transform $Rectangle01 changes do

(

if $==$Hand_control then

(



)

else

(

--remove swivel angle keys

deleteKeys $IK_Chain01.transform.controller[1]



incoordsys world $Hand_control.pos=$Rectangle01.pos

)

)

when select $fkik changes do

(



if $==$fkik do

(

if $IK_Chain01.controller.enabled==1 then

(



select $IK_Chain01

$IK_Chain01.controller.enabled=0

IKChainControl.action.assumePrefAngles ()



select $fkik



--capture current rotations

addNewKey $Circle01.rotation.controller[2] currentTime

addNewKey $Circle02.rotation.controller[2] currentTime



--remove swivel angle keys

deleteKeys $IK_Chain01.transform.controller[1]



--move toggle indicator

$Plane01.pos=[13.5823,-53.9325,0]

)



else

(

--capture current rotations

addNewKey $Circle01.rotation.controller[2] currentTime

addNewKey $Circle02.rotation.controller[2] currentTime





select $IK_Chain01

IKChainControl.action.setPrefAngles ()

$IK_Chain01.controller.enabled=1



select $fkik



--remove swivel angle keys

deleteKeys $IK_Chain01.transform.controller[1]



--move toggle indicator

$Plane01.pos=[0.610996,-53.9325,0]

)

)

)

------------------------

Then:

1) Turn on animate

2) Move ahead some frames

3) If the fk/ik switch is displaying fk, then rotate the arm handles. If it says ik then move the hand control.

4) When you have finished animating in fk or ik press the switch on the LAST keyframe of the the animation

5) Then move on some more frames and use the relavent control to adjust the arm (arm handles or hand control) .

6) Repeat for however long

As long as you press the fk/ik switch on the last keyframe of the current animation it should work ok.

Unfortunately you cannot go back and insert fk in the middle of your ik or vice versa yet. I think some more keyframes need to be added from the script.

I have included an animated version incase my instructions do not make sense.

Thanks for any interest or comments!

Spencer

CGTalk Moderation
11-26-2006, 08:50 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.