Problem: Blender bakes animations creating keyframes on each frame for each bone. This generates a huge animation file with a lot of static keyframes.
(Not animated bones get unecessary a lot of keyframes.)
In order to delete all static keyframes of character animation imported with the FBXLoader, I use the code:
// BEGIN Remove the keyframes that don’t change
object.animations.forEach(function(clip) {
for(var t = clip.tracks.length - 1; t >= 0; t–) {
var track = clip.tracks[t];
var static = true;
var inc = track.name.split(".")[1] == “quaternion” ? 4 : 3;
// END Remove remove the keyframes that don’t change
Goal is to load the baked animation file in three.js, filter out the static keyframes and export the animation as a smaller FBX-File in order to reuse it in three.js.
Thanks Nik!
This solution reduces keyframes but doesn´t solve the core of the problem!
If several bones are not at all animated or partly animated through the whole animation Blender gives them automatically keyframes in the baking process. This makes the file huge!
Is there a way to convert the heavy baked blender FBX animation into a much more compressed FBX file to be used in three.js, filtering out all static keyframes?
Thanks Lewy! Using Blender 2.80 I exported my character animation as .glb and it works on the online viewers.
Now, in order to integrate the .glb animation in a website using three.js which of the following scripts are necessary and where do I download their latest versions?