How to clone a morph target from one glb to another glb? is it possible to clone it?

Im new to babylonjs. I want to clone morph target from One to another glb Can anyone please help Is it possible.

It should work if you add the morph target manager to the right Suzanne mesh instead of the root, but it doesn’t because these two models don’t have the same number of vertices.

1 Like

Thank you for you suggestion. I change the model now both model have same vertices. Results are not same Is anything missing

They have to have exactly the same vertices in the same order. Your mesh has the same number of vertices now, but they don’t have the same positions.

2 Likes

Ohh okay Can you please help me what i have to do for exact same positions i have exported both model from blender. with similar export settings.

I don’t know much about Blender. Maybe @PirateJC or @PatrickRyan knows more.

1 Like

@Nilesh_Ghanchi, this will be the same no matter what tool you are using, but the only way to make sure you are exporting the exact same triangle list for both meshes is to use a copy of your original mesh for the second mesh. Morph targets need to map each vertex from its original position to the morph position. However, if the triangle lists aren’t the same, you will be using position data from two vertices that don’t originate from the same position.

For example, if you have a vertex at the tip of the nose that morphs up from the default position and you retarget this morph to another mesh that has the same number of vertices but in a different order than the original vertex list, you could be using a vertex on the ear to move to the morph position of the nose. There is no way to determine the triangle list manually, and any remeshing operation will change the triangle list. So the best practice is to get your mesh into a final state where you don’t need to change the mesh anymore, then make a copy of that mesh and then attach your morph targets.

You should also be able to make a duplicate of the base mesh of a morph target and detach any morph information, and that should also work. Basically, you just want to ensure that you have a copy of your original mesh and do not do any remeshing operation to either the original or the copy from there.

3 Likes