Hi,
I have a model .GLTF with 3 animations in an array.
I make this to split the animations with successful
So, when I call the crossFadeTo not work.
Hi,
I have a model .GLTF with 3 animations in an array.
I make this to split the animations with successful
So, when I call the crossFadeTo not work.
Please have a look at this example: https://threejs.org/examples/#webgl_animation_skinning_blending
It uses crossfading in order to transition into a new animation.
I made this.
SetWeight and play action, but the animation subclip is wrong⌠my model animates and freezes, after 2 seconds, he continues playing.
When I play full animation works fine, however, when I split the animations (subclip), it break.
var idleClip = THREE.AnimationUtils.subclip(animations[0],'idle', 30,40)
var idleAction = mixer.clipAction(idleClip);
idleAction.play() //don't work fine.
@Denis_Ken please provide enough information for us to fully reproduce the problem â code, your model, and ideally a demo. And please explain what you mean when saying it doesnât work â does it look incorrect? does nothing happen at all? are there errors in the JS console?
Demo is attached. (Scripts, mongoose localhost and model)
Sorry, for the texture, but I canât share.
Pay attention in animation, he plays, stop and play again, but I set âsubclipâ 30 to 40.
It works fine If I play mixerAnimations without subclip. But sequential
The model has blend shape and normal animation.
Demo.zip (1.0 MB)
Without the original .blend
file I am guessing a bit, but to confirm â you want keyframes 30â39 to be split into a separate clip and played? The glTF file contains many keyframes, some tracks more than others:
Iâm guessing thatâs not your intention⌠Note that the Blender exporter may âbakeâ your animation at 24-30fps under certain circumstances. If that happens, you wonât be able to split the animation cleanly like you want to do. Some options:
The 3D artist have just one timeline with bone animation and shape key animations of the character. And want to export it as one, like the flow with Unity. one animation sequence of bone and shape animations, and in code split the frames in sub loops to cross fade between them.
(blend file)
bot.blend (1.5 MB)
I see. The issue youâre running into is discussed here â the exporter is not providing data that can be split into frames.
Until that is fixed, you can try the two suggestions above, or perhaps export to another format. I tried COLLADA and FBX quickly â COLLADA didnât load, but FBX and FBXLoader might work. The keyframes looked much closer to your original timing.
Perhaps there are changes to .subclip()
that would support this better (slice by time, rather than number of frames, and automatically appending starting frames where needed?) but at the moment I donât have time to investigate that.