How to define morphTargetInfluences for a mesh

I looked at this example

Then I tried to add a couple geometries I wanted to try as morph targets, with 8 vertices just like the cube. I created the morph targets (I even see them in the log in the geometry), I then created a new mesh with the same exact line used in the example…

mesh = new THREE.Mesh( new THREE.BufferGeometry().fromGeometry( geometry2 ), material );

…with the only difference I used my own geometry (geometry2). The morph targets I added to the geometry do exist, but when I try to access the morphTargetInfluences of the mesh I created with my geometry it tells me it’s undefined. I checked my geometry in the log and it has the same properties, the same number of vertices and faces as the one in the example, but for some reason right after the mesh in the example is created the target influences exist, but when I do it they don’t

I also tried to add those 2 morph targets to the existing geometry, which is then used to create a mesh, and the result is that the first 8 target influences in the example are defined, the 9th and 10th I added don’t exist, despite the morph targets being added to the geometry

I saw a “similar” post on this site, but it only contains a link to stackoverflow which doesn’t exist anymore

Did you manage to find a solution as I’m currently having the exact same issue?

1 Like