akbartus / AFrame-Runtime-GLTF-Animations

A small project demonstrating AFrame GLTF animations in the runtime
https://gltfanimations-runtime.glitch.me/
MIT License
8 stars 4 forks source link

remove unneeded code #2

Closed vincentfretin closed 1 year ago

vincentfretin commented 1 year ago

You don't need to create an AnimationMixer to get the animation clip, it's right there gltf.animations[0] is an AnimationClip object.

vincentfretin commented 1 year ago

You could also add each loaded animation in the objectMesh.animations array and verify if you already have the animation in the array before loading it. Iterating on objectMesh.animations and checking animationClip.name is one way to do it.