How to disconnect/deattach bones from each other and still keep the animations intact?
I'm working on a model format which stores bones relative to root (0,0,0). There is no parenting info.
However, my importer allows to connect and parent bones during import, so the models can easily be posed and animated.
The exporter in it's turn disconnects the connected bones before export.
The problem is if I create animations for the model when the bones are connected, then the animations will mess up when I'll disconnect the bones. That sucks a lot. I thought maybe there's a way to tell Blender to apply the transforms to child bones as well, so when I'll disconnect them, they will move as well and not stay in the same place.
i don't think there is a need for disconnecting bones. If a certain format requires bones stored relative to 0/0/0, all you need to do is to calculate the global coordinates for heads/tails - no disconnecting involved.
Example: you need the tail location in global space of a pose bone
global_coord = Armature.matrix_world * PoseBone.tail
rotation matrices seem more difficult, maybe have a look at stock scripts like bvh export...
I'm sitting, waiting, wishing, building Blender in superstition...
I should have been clearer. My script doesn't merely connect and disconnect bones during import and export respectively.
The importer has a "Hardcoded" mode for armature, when the bones are generated from config files, not the matrices in the 3d files. "Hardcoded" mode works for only the generic character skeletons of our (game) format.
Anyway, the exporter then checks if the bones have been connected (by the importer) and if so "hardcodes" the armature data itself.
This is because our limited format.
So I don't think that'll work.