Name of morphTarget

Hi there,
is there a way to get the name of a morphTarget? I can’t find a name property and the morphTargetInfluece array seems to be an array of numbers.

   for (let i = 0; i < child.morphTargetInfluences.length; i++) {
        guiFolderMorphTargets.add(child.morphTargetInfluences, i, 0, 1).step(0.01).onChange(function (value) {
            child.morphTargetInfluences[i] = value;
        });
        console.log(child.morphTargetInfluences[i].name);
    }

Greets :slight_smile:

Try to access Mesh.morphTargetDictionary. It’s an object with the following structure:

Key: Name of morph target
Value: Index which refers to the concrete morph target data in the geometry (Geometry.morphTargets or BufferGeometry.morphAttributes)

I’ve created a small fiddle that prints out the object to the console:

https://jsfiddle.net/f2Lommf5/11522/

1 Like

That’s what I have searched for.

Thank you @Mugen87.

Greets :slight_smile:

1 Like