New FK/IK switch

very cool trick… nice for those of us getting the grips of animation in Blender…In Max’s Biped, you have ik/fk at any moment, that is, you can handle in both ways just clicking on the bone and dragging. but doesn’t do in 100% of bones, so I guess some sort of trick is under surface… that is, you can just grab a hand and works like Blender’s auto-ik , but also handle totally free any obne of that chain. I think there is not so much freedom with max bones (I say 'cause yet havent handled M. 2008, nor 2009, it may have changed.).

That trick seems really good, I’ll try to use it…I was doing very complex helpers and constraint rigs to calculate every possible need, but combining with that sounds powerful.

that the behaviour of <1 influence Ik is bad,

another interesting tip… was using that with a pair of limiting distance constraints…

yet tho, I get the feeling I’ll have probs if I just dont rely simply in my ik and helpers rig…

Just want to second that, as well as add that it’s not only safer (in terms of avoiding weird flipping) but also just looks better. Using a copyrot with two chains makes the arm rotate between them like FK (i.e. you get arcs). It’s basically just all-around a better way to do things.

The hard part is somehow tracking that change as you change the animation poses or timing; this requires either moving the keys along with the blend, or rekeying visual rot; something to be done by hand. in practice it’s easier if you did it by hand the first time, to remember to do it again. otherwise, it’s something hidden that comes and bites you in the a$$.
Right, to make that work well for the user the FK/IK switch keys would have to be somehow linked to the actual arm keys that they coincide with. And both the IK and FK controls would have to be keyed and kept in sync at those points too.

The difficulty in making FK/IK switching really work well actually has little to do with the initial keying. Rather, it’s about making it easy and seamless to tweak the keys afterward.

Wow. I had no idea making an IK/FK switch would be so difficult in Blender.
I’ve used eFrontier Poser 7 a little bit and all you do is click to check
and un-check IK for each hand and foot. That’s it. No side effects. Nothing
moves or changes other than how they act when you move them. Same
with Autodesk Motion Builder (from what I’ve seen in the demo video) except
that’s a bit more advanced.

After being exposed to those, the work around in Blender seem a bit going
out of the way to make it happen, which in the end would probably add up
to hours spent adjusting IK/FK as opposed to a few seconds of turning it on
and off in other software.

I hope there can be a simple feature added in the future like these other
programs have. For now, the best way for me seem IK for the feet and
keep the arms as FK. It’s a bummer though.

I’ve been trying to pick this file apart to see how it was set up and I
cannot figure it out. I don’t see any drivers or contraints, or triggers
or whatever they would be called. I can’t see anything in the IPO window.
I don’t know how moving the switch is causing IK/FK to alternate.
I can see some things in Oops when showing all layers named:
upperarm_ik
ColIpo.003
CoIpo
arm_fk

Please, do tell how it was set up. I want to give this method a
try until a better one gets developed. Is there a tutorial somewhere
I have overlooked?

Edit: Oooh. Maybe I just figured something out. I forgot to check the armature layers.

Ghost_train there are constraints, third chain is constraint to follow either IK or FK chain. You just have to turn other bones layers on.

Maybe I am missing something here … but doesn’t the improved Auto IK in 2.46 do this already ? Since now you can change the IK chain length “on the fly” as it were with the mouse scroll or the pg up/pg dn keys, if you set the IK to chain length = 1 = FK , chain length > 1 = IK … with no popping to a target since the rotations are evaluated depending on the length of the chain between poses …

“But what about the nice target that the IK Solver constraint gives you ?”, you might ask … Well why not just “fake” one by adding a non deforming extra bone which is attached to the end of the chain with all its rotations locked (another improvement - Auto IK now conforms to axis locks in the Transform Properties window) which will act as the target for constraints such as Copy location ? You need to have the chain length to at least 2 for FK and more then that for IK with this setup .

The IK length once specified gets inherited by any other bone you choose so if you want to go all FK you can choose chain length 2 if using the above setup and add additional control bones at the elbow for consistency, so that when you go from the “target” at the wrist to the elbow it will behave as a FK setup if you leave the chain length alone …

The chain length value shows up in the 3D header along side the Dx/Dy/Dz values when you hit the G key with a bone selected .

The biggest problem with IK/FK switches is the fact that you couldn’t adjust the chain length in the constraint (because a IK chain length of 1 behaves like FK except you pose with a target so if you could change you could go from IK to FK or vice versa with no problems) so that it left you with a sudden snapping of the constrained bone when going from FK to IK … now that the Auto IK allows you to change the chain length while posing/animating you can just go on and pose in FK or IK depending on the situation without worrying about sudden snapping or even dealing with a separate switch to go from IK to FK … And mind you, you can have IK “on the fly” for any bone in a chain and as long or short as needed … And no more “lost” targets since the “target” is (unlike the constraint) attached to the chain length :slight_smile: This is a very very flexible addition and very easy to set up …

I’ve attached a simple arm/torso rig … And yes no Pole Targets either but the elbow “target” can be moved around to do the same thing … Hit G and the current IK length of 3 will show up in the header . Go from the wrist to the elbow “target” and change the IK length to 2 for FK (use the pg up/pg dn buttons - they are more predictable then the scroll wheel) : http://uploader.polorix.net//files/307/AUTO%20IK-FK.blend

very useful thread… Thanks!

Maybe it would help if there would be a feature (an option) for the constant that when you zero it there is recorded visual key i.e. that the object that previously had this constraint active will keep resulting constrained position even the constraint was zeroed.

But I guess Aligorith has already some improvements in his mind for Blender 2.50. According to premise (nearly) all key-able in 2.50 :slight_smile:

perhaps; the more general form of the problem is: at the point of switching you have: IK bone positions, FK bone rotations, and the switch itself. Later on in the animation, if the animator changes one of these (either in time or in value) the others should, or might have to change also. Another possibility is to “grey out” fk keys during IK mode, and IK keys during FK mode (these get handled automatically by blender or the script).
I think it would also be nicer for the animator to get a nice toggle FK/IK instead of a bone slider; if it’s scripted, the bone could still exist, but only to give keys/make it trackable/editable.

Recording the key automatically as you suggested is already done by e.g. malefico’s script, and even if it’s done automatically by blender, the result is the same; you get the convenience during the switch, but now it has to be handled when you edit the action.

I don’t think it really matters if the solution comes 100% from blender or from python, the important part is that it works, allows easy adjustment of the animation, and that it is flexible enough for many different rigs.

Every night I go to bed crying.
It’s because we don’t have that simple easy IK/FK switch that Poser has.
I definitely took it for granted while using that software.

How about someone cram all the best parts of every awesome 3D application
into one big ball of food for Blender to eat.

Bassam, referring to your attitude have played lately with cessen`s biped rig.

Best steps for no-jumping FK/IK switch are following:
Before going from FK to IK I always for each IK controller need to one frame before switching:

  • Select IK controller
  • Shift select respective FK controller (Hand.L - IK_Hand.L, ElbowTarget.L - ForeArm.L, KneeTarget.L - Shin.L, IK_Foot.L - Foot.L)
  • Ctrl-C Copy Pose Attributes - Visual Location
  • Ctrl-C Copy Pose Attributes - Visual Rotation
  • Select just IK controller
  • Hit I (Insert Key) VisualLocRot

Before going from IK to FK I always for each FK controller need to

  • Select FK controller
  • Hit I (Insert Key) VisualRot

I guess there really could be a “python macro” for this repetitive steps. And then just to connect the macro to the one button or even switch itself.

Nice is the over all control of the animator using this keying method also for later tweaking.

Sorry for bumping this year old thread.

I’m trying to animate a switch from IK to FK using Mancandy whilst following the workflow Bassam outlined in post #19 of this thread. I have set a ‘VisualRot’ key on all of the bones in mancandy’s arm before switching to FK, yet there is still a noticeable pop in the animation. It kind of looks like his arm grows ever so slightly.

Does anyone know how to solve this problem?

Many thanks

Hello, I believe the problem is in the way how IK squash and stretch works in Bassam`s Mancandy rig. Mancandy uses stretch value for IK in Armature Bones panel. Even it is the lowest possible 0.001 the arm in fact is always scaled in IK a little bit (including no extreme positions). This is why FK - IK switching with Mancandy “hopes”. FK chain is not stretched but IK is always scaled a little, so their positions cannot match.
(You can try to set 0,000 value for stretch and “hoping” should stop - but you will not have stretchy arm.)

The only solution is to use more accurated stretchy IK setup. For example the one I have used for George rig. FK - IK swithcing is 100% seamless in George rig.
Link here - http://blenderartists.org/forum/showthread.php?t=161257

Hey JiriH, thanks for the reply.

I tried setting the stretch value for the ‘toparm’ and ‘lowarm’ bones to 0.000 as you suggested, but the problem still remained. I can’t work out how to make mancandy smoothly switch from IK to FK. Maybe it’s not possible. :frowning:

Thanks for the link to your George rig. If there is no solution for Mancandy then I will give George a go.

EDIT: I just got it to work by setting the stretch value for the ‘toparmIK’ and ‘lowarmIK’ bones, hidden on the 11th bone layer, to 0.000 as well. Just a shame Mancandy is no longer stretchy after doing this.