I am attempting to import an animated GLTF model. However, the animation is not fluid (like the original) but rather a stiff rocking motion.
Original
Our result
CODE
var mixer; var clock = new THREE.Clock();
// model
gltfLoader = new THREE.GLTFLoader()
gltfLoader.load( "shark.gltf", function ( model ) {
mixer= new THREE.AnimationMixer(model.scene);
model.animations.forEach((clip) => {mixer.clipAction(clip).play(); });
scene.add(model.scene)}
// renderer
var delta = clock.getDelta();
mixer.update( delta )
Hi, I re-use your code to import my GLTF animation from Blender3D. I just combine translation and rotation on my model and I don’t understand why but my animation generate is diferent from the original.
Below a gif of my original animation :
My GLTF use sometimes scalable information instead of big rotation : charbon.glb (119.8 KB)
I document me on three.js since yesterday. I’m not sure if it’s the best place to expose my issue and if it’s not the case could you tell me the best place to do it ?
I’ve tested your model with Sketchfab, Babylon.js Sandbox and the three.js based gltf-viewer. They all visualize the asset in the same way. The smaller cubes which appear and disappear are not visible. Maybe you are doing something wrong when exporting the model from Blender? If not, consider to report an issue at the repository of the Blender glTF importer/exporter: https://github.com/KhronosGroup/glTF-Blender-IO
Oh, sorry it’s my fault, the smaller cubes are generated particles from an other model inside the principal cube. I don’t include this because particles is’nt supported by glTF-Blender-IO.
It’s an old thread, but just in case someone needs to know, to start animation one after another you must execute next animation once the current animation finishes
mixer = new THREE.AnimationMixer( model );
const clips = model.animations;
var t = 0;
$.each(clips, function(i, clip) {
setTimeout(function() {
mixer.clipAction( clip ).play();
}, t);
t = t + (clip.duration * 1000);
});