baking RVK value from bone driven ?

I am facing a problem :

I need to export an animation to the OGRE game engine.

I have a character mesh rigged. Some parts have bone driven shape keys, to correct joints, mostly at shoulders, knee and elbow.
Ogre doesn’t support bone driven shape keys, but
it DOES support blending a relative key into the skeletal animation. I only need to have a keyframed ipo as the shape driver, instead of the bone->ipo->shape schema.

So , what I am trying to do is to bake the result of the bone driven shape key into an ipo, wich will be time related.

Not very clear…

Lets say it like that :

I have a bone driven shape key. Bone moves at frame X . the new bone rotation Y is interpreted by the ipo driver, that sends a value Z to the shape key blending value.

What I would love, is to get by any possible ways, an ipo created for a copy of my shape key, this ipo curve would be the DIRECT relation between X ( time) and Z (shape blend value ), keyed.

If anyone knows a python script that does this, or if someone is able to write it, that would really be helpful…

sorry for beeing confuse, I don’t see how to explain that better.

you can look at my animation bake constraints script that computes the net rotation of a bone based on all influences, and makes a key. see Tutorials/Motion Capture part 4 I think is where I get into baking the bones.

that seems to be the solution ! Thank you very much

Unfortunately, I get an error at running the script:

debug: Animation Bake Constraints 0.7 Script begins with mode=0 debug=0 batch=False
debug: Baking 1 objects
debug: Baking Armature object [Object “Armature”]
Traceback (most recent call last):
File “<string>”, line 792, in <module>
File “<string>”, line 778, in benchmark
File “<string>”, line 762, in main
File “<string>”, line 622, in bake
File “<string>”, line 331, in bakeBones
TypeError: getBakedPoseData() got an unexpected keyword argument ‘ACTION_BAKE’

well I removed the # in line 107 reload(BPyArmature)

it seems to make blender happy.

But In the copied armature, the bones that are part of an IK chain do have correct ipos ( which is what I needed :), but they don’t move on the screen. That is odd.

Anyway, I could copy to buffer the curve that I want, and use it to key my shape blend value !

Thank you VERY much !!

ah, yes, the file contains an updated bpymodules/BPyArmature.py file, so you have to either reload or delete the pre-compiled version BPyArmature.pyc. I will add that note to the page.

The bake starts the action at frame 1 by default (you can change it in the code if you wish, see the flag up front in the file), so baking frames 300-600 will result in an Action from frames 1-299. So, if you “play” the 300-600 range, the baked armature won’t move. instead, play 1-299.