-
-
Notifications
You must be signed in to change notification settings - Fork 36k
Description
I have been using the blender exporter to export skinned mesh with animation data. It is the only exporter I found that actually works, so good job on that. However, the problem becomes more apparent as the complexity (in terms of number of bones and number of animations) of the model grows -> the three js exporter takes too long to export (10min +) and the JSON file outputed is too big (not that big of issue atm).
Upon inspection, I think I found the problem: the exporter writes all keyframe data (rot, scl, pos) for each bone for every frame step, even tho they are not keyframes. As you can imagine there is a lot of waste since motion that could have been described by a few keyframes is now described in many more frames. Many of which are simply useless. For example, for many bones, 2 keyframes, one at start and one at end is suffice to describe the motion but the three js exporter will export many intermediary frames that just takes up space. Not to mention many bones in animation simply do not have keyframes at all but three exporter is happy to write the same data over and over again.
I have considered to handle this client side as a preparation setup to remove the non-keyframes but it is not trivial because then I need to determine for each frame whether or not that particular frame will affect the animation. It would be much simpler on the blender side as information on whether or not a particular frame is a keyframe is accessible. (I think)
Now, I must admit I do not use three js for displaying so this format may be required for three to display the animation correctly. If this is the case I guess I will just have to come up with some method to remove the non-vital frame data. The difference should be considerable: I estimate a reduction of 75-90% in animation data size from sampling the ratio between keyframes and non keyframes in blender.