Right now I’m finishing simple python script for Blender that removes IK helper bones from model and bakes all “actions” into forward kinematic (right now baking itself is performed using script from Blender package, sometimes with devastating consequences). In current state it’s already usable but not very optimized or user friendly.
So far, I have three questions:
What implementations of similar tools do you know?
Is anyone here interested in it?
If “yes” to 2, then what features would you like to have in addition to basic batch-baking?
UPD: explanation of current state and future plans (for ones who will not find it in comments)
Right now my script creates full clone of original armature, removes constraints and helper bones from it, adds “copy transform” constraint to every bone targeting original armature and then bakes single action using built in baking script, repeating last two steps for every action to achieve batch-baking.
In current state after execution of my script I get
original model, armature and actions unchanged
cleaned clone of armature, ready to be applied instead of original
copy of every action, containing baked animation, targeting cloned armature
some random trash in actions that comes from built in baking script and is not linked anywhere, so it disappears next time model is loaded
What I really want to achieve for my own use - one-click transformation from IK-based model into game-ready model:
original armature and actions should be erased
remaining actions should have game-ready names
no additional editing should be performed between baking and importing to JME , ideally it should automatically save baked model in separate .blend file
baked animations should be optimized, removing all unnecessary keyframes and tracks, ideally converting them into the best supported by JME format (I’m not sure what types of keyframes, interpolation and animations are currently supported by JME)
maybe some transformations not directly related to animations - additional preparations of geometry, textures, materials and so on
edit:
support for skeleton compatibility check as I’ll use animation retargeting a lot and early warning about wrecked skeleton will be handy
Then it’ll be possible to have IK-based model as source and bake it only as part of importing pipeline, performing all modifications in not baked model.
Though this ultimate mode could be optional - sometimes one just needs to bake animations for some reason.
UPD: planned checklist for JME-readiness
check if there are some not split sharp edges in model and offer to split them to avoid problems with normals (or at least just apply Split Edges modifier as fast and dirty sollution)
I think there is a built in function in blender that does it.
Used in once, but it’s destructive for your animation, because it sets a keframe on each frame…
Though I din’t use it in a while so it may have been improved.
A nice feature could be to create the baked animation next to the original one. Like myAnim and myAnim+baked.
Yes, that’s the thing, I even use that built in baking script to bake single animation after preparation of armature. But it still works only with single action and is destructive in various ways.
Right now my script creates full clone of original armature, removes constraints and helper bones from it, adds “copy transform” constraint to every bone targeting original armature and then bakes single action using built in baking script, repeating last two steps for every action to achieve batch-baking.
In current state after execution of my script I get
original model, armature and actions unchanged
cleaned clone of armature, ready to be applied instead of original
copy of every action, containing baked animation, targeting cloned armature
some random trash in actions that comes from built in baking script and is not linked anywhere, so it disappears next time model is loaded
What I really want to achieve for my own use - one-click transformation from IK-based model into game-ready model:
original armature and actions should be erased
remaining actions should have game-ready names
no additional editing should be performed between baking and importing to JME , ideally it should automatically save baked model in separate .blend file
baked animations should be optimized, removing all unnecessary keyframes and tracks, ideally converting them into the best supported by JME format (I’m not sure what types of keyframes, interpolation and animations are currently supported by JME)
maybe some transformations not directly related to animations - additional preparations of geometry, textures, materials and so on
edit: 6. support for skeleton compatibility check as I’ll use animation retargeting a lot and early warning about wrecked skeleton will be handy
Then it’ll be possible to have IK-based model as source and bake it only as part of importing pipeline, performing all modifications in not baked model.
Though this ultimate mode could be optional - sometimes one just needs to bake animations for some reason.
Yes, in mode “one button to bake them all” it should be used on separate .blend file to not screw original, be it created by script itself or just by hand.
To be honest, I’m not sure if I’ll be capable to achieve all goals I put :chimpanzee_wink: but current version is already usable and could be released to public after some polishing.
Interesting may be we can collaborate on xbuf. The xbuf blender addon export only NLA strip as animation.
EDIT: For point 4, JME core only support linear interpolation, I did some try with other interpolation: like bezier (on blender and jme side), it works but in blender it’s only available before baking, and it ignore other animation constraints (IK, …). I talk about the xbuf pipeline, not the jME blender importer.
I hardly see how it could be done as I don’t plan to do any “export” stuff myself but if you have ideas where it could fit into your pipeline - I’m open for collaboration.
However, keep in mind that I focus on blender importer pipeline and internally use stock action baking script for now so it may be a bit tricky to adapt to xbuf ways of doing things.