Splitting an animated mesh while preserving the animation of each part

Take an animated mesh, split it and every piece keeps its respective animation.

Any ideas?

Via code? Yikes. Short of copying every piece of keyframe information, I don’t see how you would do it.

Wouldn’t it be easier to create 2 objects that use the same skeleton for animation purposes, one with a single mesh and one with multiple, and swap them in/out?

Yeah but that will only split the mesh, I want to separate the pieces and their animations to continue running.

I considered to copy the bones for each part and delete the extra ones. But that sounds way too bad performance wise because animations will try to calculate positions of bones that do not exist.

Maybe try and explain a bit better what your ultimate goal is?

Split a mesh into 2 different meshes. They keep the respective animations.

For Example:

A chopper with 2 fins - top and back. It is fully animated ( fins and door opening ). I want to create 3 meshes - 1 for each fin ( keeping its animation ) and 1 for the door ( again with its animation ).

I was doing something similar, I’d recommend this class: http://unity3d.com/support/documentation/ScriptReference/Keyframe.Keyframe.html

I will give it a shot! Thanks.