How to record IKsolver's resulting animation?

Hi all ,

I’m found of Blender IK solver … it is just amazingly powerful !!

I find it is very convenient to quickly animate squelet-based characters …

Alas … I can’t find a way to record the bone animation into an Action Strip or into some ipos .

I use the IK solver to help me in animating characters … and I’d like to use the produced animation into BlenderGameEngine , as an autonomous Action Strip … (without IK Solver).

I tried various way to “Bake” the animation:

1- I tried to play the animation while armature is in Pose Mode … and I inserted Keys for all bones at some key frames …
But the resulting action is just flat …

2- I tried to make a script to read bone’s Quaternion at every frame … and record them in an other action Strip … it doesn’t work either :frowning:
The value read from bones are the one corresponding to the rest position …

IKsolver act as through Bones wasn’t moving …
it’s frustrating …
I really don’t know how to record IKsolver’s work …

Does anyone have an idea ?

Some people told me that recording IKSolver’s anims used to be possible … is it planned to make it possible again in the futur ?

I think of parenting empties to each bone separatly (or using a follow constraint)… to make empties follow bones … and then make a script that record empties’position (instead of bone position) … and rebuild bone’s quaternion from empty’s rotation
is it feasible ?? isn’t there a simpler approach ??

Thank you …

Jean-Baptiste …

Are you talking about Blender 2.37?

http://download.blender.org/documentation/htmlI/

Or 2.40a ? in which case you will have to say what you mean by IKSolver. It is just a constraint but in 2.40a can be set to target an Empty, a Bone of the parent Armature or set to “AutoIK” in which the bone with the constraint becomes its own target.

%<

The result is the same with both 2.37 or 2.40

I don’t know how to record squeleton animation that was made by using the IKSolver.

I made several animation thank to the IKSolver … Now, the goal for me is to record evolution of bones’position along time into an Action strip or IPO curve (whatever) in order to replay the animation without using IKSolver …

If you know a way to do that either in 2.37 or in 2.40 … I’d be highly interested in knowing it…

By IKSolver … i mean the algorithm that allows Blender to re-compute bones’orientation for a slight variation of the end effector position.

Jean-Baptiste

I don’t really get your question but I think you want to BAKE the Action. This makes every frame a keyframe so IPOs and solvers are no longer needed.

So, make your animation then go into the Action window and press the Bake button. It takes a little while (depending how long the animation is) then it saves this as a baked action. If the original action was called Action.001 the baked one will be Action.001.BAKED and if you select it, you’ll see every frame is keyed.

I’m sorry for my english is very poor … and it’s somewhat difficult to me to accuratly convey what I mean.

Please, find below a detailed explaination of the issue I’m dealing with.

1- create an armature with three bones named Bone, Bone.001 and Bone.002
so that Bone is parent of Bone.001 which is parent of Bone.002.
(Space -> Add Armature , LMB click twice at various position)

2- enter Pose Mode
(Ctrl-Tab)

3- Select Bone.002
(RMB click on it)

4- Add an IKSolver on Bone.002
(Ctrl-I, To New Empty Object)

5- Leave Pose Mode
(Ctrl-Tab)

6- Select the newly created empty
(RMB click on it)

7- Insert an animation key on frame one for this empty
(I, LocRot)

8- Go to frame 11
(UpArrow key)

9- Grab the empty to an other location
(G, Mouse move, RMB click on new position)

10- Insert an other animation key on frame eleven for this empty
(I, LocRot)

11- Go back to frame 1
(Down Arrow key)

OK … now we have an animation for the empty … and the end effector of our armature is following this empty thanks to the IK Solver …

Let’s note that only our empty is animated … there are no animation key for armature

Now, I want to play the armature animation without using IKSolver facility…
For instance … after removing the empty … and the IKsolver constraint on Bone.002 …

My question is :
How to keep a track of armature animation so that I can play it without IKsolver constraint?

I tried several method (as explained in my first post) none of them work
neither in 2.37 nor in 2.40

I also tried to BAKE the animation … it doesn’t work … only the rest position of the armature is Baked

Is there a way to save the animation produced by IKSolver ? (i mean the evolution of bone’s position and orientation along time)

I hope I’ve managed to make myself a bit more clearly understood … in spite of my poor english …

Jean-Baptiste

Okay, I think you might be better off using a bone as the IK target instead of an empty. So instead of using CTRL-I to add the IK solver, add an extra bone (Bone.003) then select Bone.002 and add an IK Solver constraint in the constraints panel target Armature>Bone.003

Then animate the target bone, then bake the action. I think that’s what you’re after.

Edit: Oh, and don’t apologise for your English. You’re doing better than I could do with any other language. :slight_smile:

AndyD … thank you for your reply …

The method you advise me to follow (with a bone as target) is the one that was used before 2.40

It agree with you that it allows to animate the armature …
But it is still impossible to get rid of IKSolver because the only relevant animation key for my armature is the one I putted onto Bone.003

If I remove the bone Bone.003 … the armature no longer moves (even though I recorded keys for all other bones during animation).
The IKSolver constraint is still needed to play the animation.

If I record keys for other bones … all the keys are “flat” . I mean they’re corresponding to the rest position of bones … and they don’t evolve over time …

I think I have to conclude that it is not possible to retrieve the bone position and orientation for each frame …

I think it is a pity … because IKSolver is very powerful (especially in 2.40) … and not being able to use the resulting animation in an exporter or in GameEngine is very frustrating to me …

Jean-Baptiste …

Damn! You’re right. Sorry about that. I’m out of ideas but I’m sure it can be done because lots of people use Blender for gaming characters.

EDIT: I just tried my method in 2.37a an dit works exactly as expected. If you bake the action, you can remove the constraint (not the bone) and the animation still plays.

However, 2.4a2 seems to be “broken” (or very different?). It shows keys added for all bones when you bake the action but it doesn’t appear to append IPO data to the individual bones.

Perhaps this is one of the areas still under re-construction.

I know it’s possible …

I’m currently making a script that’s going to allow me to export bone animation … so that I can import this animation …

But I’m surprised that I need a script to do that …

I was sure it was possible right inside Blender …

anyway … thank you very much for helping me

Jean-Baptiste …

after removing the empty

Don’t remove the Empty!!!

Whether you use an Empty or a Bone as the Target for your IKSolver Constraint, the IPO’s for the animation are written only to that target (and the IK Chain follows it; that’s what an IK does). If you remove the target then you remove the IPO’s (Action) and the chain has no instructions, no algorythm, to work from.

%<

Thanks Fligh …

I know that removing the empty will break the animation

I was just wondering how to record the animation to make it autonomous … I mean working without IKSolver

Because IKSolver is not usable in BlenderGameEngine …

any idea Fligh ?

have a look at this file if you want to test your idea …

But he wants to run it in the game engine where constraints don’t/didn’t apply. Baking is supposed to compute all manipulations for individual bones at each frame and write an IPO for them so that the constraint is no longer used.

Deleting the Empty may confuse things (deleting the target bone sure does) but he needs to be able to turn off the solver constraint and still have the keyed animation play. It works in 2.37 if you bake the animation but not in 2.4 it seems.

Even selecting every bone and keying it before baking doesn’t work. It’s like their rotation/location data isn’t being read while the IK is active. Only the IK bone data is being recorded.

Maybe the new game engine reads constraints??? That would explain the change.

You bake the Actions in the Action Editor and the IKSolver and it’s Target must still be intact to do that. Then you can take that Baked Action to the GameEngine (I think, but ask in the GameEngine forum).

%<

Once an action is baked, it should be possible to remove the IK constraint (not the bone, just the constraint) and the animation should still play in the 3D editor since every bone has been given an independent IPO keyed for every frame and is no longer following the IK target anyway.

It works in 2.37a but not in 2.4a2. It seems to be either broken or changed.

It turns out that with 2.40 RC1, BAKING is only possible with Automatik IK.

It is still possible to bake non-IKSolver animation … but animation using IKSolver are unbakable.

A bit frustrating …

Thank you all for your help .

Jean-Baptiste