Getting different verticies count for morphing

Hello guys,
I’m trying to make customisable height of character through morphing target. I have created simple low poly model in blender which is my default mesh to morph, then i have duplicated the same model and just moved the verticies slightly so that the second mesh is taller. In blender the geometry info says that there is same count of verticies, which it should be. I didnt add any verticies while modifiing the mesh. But after exporting it with blender to babylon exporter i get a huge difference in vertex count. Im new to babylon so idk if this is a good solution but I would still love to hear why is that. o.O Any ideas ?

Here is the screen in blender:


I looked into the log file of exporter and info is also correct:

processing begun of mesh: model
	num positions      :  453
	num normals        :  453
	num uvs            :  906
	num indices        :  1986

processing begun of mesh:  morph
	num positions      :  453
	num normals        :  453
	num uvs            :  906
	num indices        :  1986

Console log :

Babylon.js v4.1.0-alpha.7 - WebGL2

geometry of meshes: (geomtery._totalVertices) - {model: 396, morhp: 1986}

babylon.js error: Mesh is incompatible with morph targets. Targets and mesh must all have the same vertices count.

Thanks in advance for any ideas why that might be the case :slight_smile: Have an awesome day!

Morphing is not supported this way from Blender. You are doing it on your own in Javascript. If you had only one mesh, and added a Basis shapekey & a 2nd one say, Taller, then you just edit the shapekey.

When export occurs, it will put just theTaller shapekey in as a morph target. You just need to call it upon load.

This way is also more scalable. If you had more vertices, you would not have to have duplicate normals, uvs, vertex colors, matrix weight, matrix indices, & indices, which I assume you never use.

Thank you for your response :slight_smile: I didn’t know that i can do it with shape keys. I ussed asset manager to load meshes from single file, then extracted the morph (the taller mesh) with getMeshByName(‘morph’), set its setEnabled attribute to false to hide it and used it as morph target with MorphTargetManager to manipulate the mesh called model. I tried to do it with help of this playground example:… So i got two questions:

a, Is it still possible that this might be some kind of unexpected behavior?
b, Is there any difference between the shapekey way you suggested and the way i used?