ClipAction select range to play

animation

#1

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.

Thanks in advance.


#2

same here buddy, been giving me headache lately


#3

Good luck.
I am going to be busy some days… Then I’ll keep looking for a solution. If I find it I’ll share it.


#4

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.


#5

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 :sob:… 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 :unamused:
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 :wink: !


#6

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.


#7

Yes you right but before merging animations together i still need to dive into each exported JSON file for manually rewrite the “default” name


#8

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 :wink:
Here is the pull request i did : https://github.com/mrdoob/three.js/pull/12646
Thank you for your help and advices