MorphTargets in ColladaLoader

Hello,

I have nearly succeed to implement a partial support of morph target in the ColladaLoader but i can’t get them to influence the mesh…

I have check morphTargetInfluences and i’m also able to create an AnimationClip out of the morphAttributes. I have no error messages in the console.

My object has 768 tris (param count of the dae ‘polylist’ tag).

Here is a dump of the relevant parts of the object:

{…}
 _listeners: Object { dispose: […] }
 attributes: {…}
     color: Object { itemSize: 3, count: 2304, normalized: false, … }
     normal: Object { itemSize: 3, count: 2304, normalized: false, … }
     position: Object { itemSize: 3, count: 2304, normalized: false, … }
     __proto__: Object { … }
 boundingBox: null
 boundingSphere: Object { center: {…}, radius: 1.7320508075688772 }
 drawRange: Object { start: 0, count: Infinity }
 groups: Array [ {…} ]
 id: 5
 index: null
 morphAttributes: {…}
     normal: […]
         0: Object { name: "crash1", itemSize: 3, count: 768, … }
         1: Object { name: "crash2", itemSize: 3, count: 768, … }
         2: Object { name: "crash3", itemSize: 3, count: 768, … }
         3: Object { name: "crash4", itemSize: 3, count: 768, … }
         4: Object { name: "crash5", itemSize: 3, count: 768, … }
         5: Object { name: "crash6", itemSize: 3, count: 768, … }
         6: Object { name: "crash7", itemSize: 3, count: 768, … }
         length: 7

The modified code is here: https://gist.github.com/frankiezafe/5ccc704fd37b2dc30768a8c4c00db457 and the commit is here: https://gitlab.com/frankiezafe/sisyphus/commit/d963fff9be98e5a450a91e5092b0f34b2a1c4142

What do I do so wrong?

Thanks in advance, threejs rocks!

As an alternative, try to convert your DAE file to glTF via collada2gltf and load it via GLTFLoader.

1 Like

Ok, thanks for the tip! I wrote an export script in blender and a simple loader in threejs this morning, the job is done (for now :)).
Export script > github
Import object > gitlab

1 Like