Hello,
I’m trying to develop a speaking avatar. I have all the visemes in a unique animation (FBX) (I don’t know too much about this topic, I think it’s just one track…).
With next lines I can play the full animation.
…
…
var action = model.mixer.clipAction( animation_visemes.animations[ 0 ] );
action.play();
…
…
What I want to do is to play a range of the animation depending on the viseme.
For example:
For “A” viseme i want to animate frames from 2 to 4.
For “C” viseme frames from 8 to 10.
I have tried several things but without success.
Someone knows how could it be done? Help would be appreciated.
FBX only support a single animation track per file, and as far as I know there is no (easy) way to split the animation up like that in three.js. At least, I’ve spent a while trying it and never found a way.
So the best solution is to export multiple FBX files - one with just the model, and and then others with each section of animation, and then apply the animations to your model.
Hello,
i’m also trying to find a solution for using multiple small animated actions made in Blender.
The best way could be to export all actions in a JSON file but unfortunately the Blender exporter doesn’t allow to export all actions … only the one selected in the Dope Sheet. ( am i wrong ? )
So actually ( before waiting the Blender exporter allow to export all animated actions ), the possible best idea could be to use one only looonnnggggg action and cutting it for making multiple actions. And in this case it could be great to play the ClipAction (From frame (x) To frame (y)…).
The other solution i found, could be to export each of my animated actions in multiple JSON files and eventually conbine them manually ( by copy/paste the "animations node content of each file and rename the initial “name”:“default”) into one single JSON file
If someone here have a good way for dealing with multiple Blender animated actions, i take it ! or if someone here know how improve the Blender exporter !
The other solution i found, could be to export each of my animated actions in multiple JSON files and eventually conbine them manually ( by copy/paste the "animations node content of each file and rename the initial “name”:“default”) into one single JSON file
If you have to do this many times then you could easily write a script to do this.
Hello,
because actually it’s just allowed to export one “Big” Action (and try to split it for doing small strips with different ranges to play…), i tried to modify the Blender exporter for making it available to export all Actions of the .blend file.
I am really really novice in Python scripting (for being honest : since this morning…) and really new on Github, so if someone experienced can watch what i did, check it and tell me if it’s good
Here is the pull request i did : https://github.com/mrdoob/three.js/pull/12646
Thank you for your help and advices
Could anyone share a model with different animations in different ranges of the same clip? I would think you could do this, but haven’t tested:
// loaded from model or whatever
var clip;
// poor man's "clip.clone()"
var clip2 = THREE.AnimationClip.parse(THREE.AnimationClip.toJSON(clip));
// trim each clip to times
clip.tracks.forEach((track) => track.trim(0, 5));
clip2.tracks.forEach((track) => track.trim(5, 10));
Perhaps a utility method to split clips in one step would be a good addition to the library.
Kupoman/blendergltf exporters also supports multiple actions directly, and is an option if you’re using Blender.