Animations aren't playing well, am I even doing this right?

I’ve read the documentation i’ve done everything but this is just not working.

So I have this fbx/gltf whatever file and the animations are wonderful inside of 3dsmax, maya, c4d whatever, but when I import them into threejs and loop through and play the animations they’re just not behaving properly.

Here’s my fbx with the animation: https://drive.google.com/file/d/1YzsRZpl5jM8Ax6IldvWr6tjJYyt_o2wC/view?usp=sharing

and my gltf file: https://drive.google.com/file/d/1DHyfQXR0zN0iyopumXFC0ckrBaDxeDYi/view?usp=sharing

I am absolutely lost any and all help would be absolutely heavenly.

Thanks in advance <3

ps here’s how I’m doing it with code:

const loader = new GLTFLoader();
loader.load(logo, obj => {
  // GLBLoader
  console.log(obj);
  obj.scene.scale.set(0.001, 0.001, 0.001);
  obj.scene.position.set(0, 0, 0);
  this.scene.add(obj.scene);
  this.object = obj.scene;
  this.mixer = new THREE.AnimationMixer(this.object);
  obj.animations.forEach((animation, i) => {
    this.mixer.clipAction(animation).play()
  });
});

What was the glTF version created with? I’m not sure it’s written correctly, and you definitely shouldn’t need to play a separate animation clip for each fragment in the model… taking the FBX version and converting it with Facebook’s FBX2GLTF, I think I’m getting the right result:
A0694F20-422E-47E8-A2DB-B40D5912A558-11429-0000027A32A512E1

(testing in http://gltf-viewer.donmccurdy.com/)

1 Like

Exported it with the Cinema4D GLTF exporter. Is there a better way of doing it? I’ve done some three js in the past but it’s my first time working with this kind of stuff. Should I be considering adding a physics engine and doing this all in code?

Also can you please provide me with that file because every time I’m trying to do this I’m literally getting just absolute botched models it’s so frustrating :confounded:I’m so sorry for the trouble

Oh ok – the C4D exporter is very new and still in “Maxon Labs” (which I guess is experimental stuff?). I didn’t know they had animation support yet actually. Anyway this conversion with FBX2GLTF works:

explosion.glb (1.4 MB)

Maybe worth filing a couple bugs on the C4D exporter if there’s a way:

  • file should include an asset.generator string so devs can identify how it was created
  • animations should be bundled into a single glTF animation entry if they’re meant to be played together, not separate small animations for each piece of the model
  • something is buggy in the TRS animation export, maybe quaternion rotations need to be resampled.
1 Like