Get position of morphed vertices (morph targets)


I develop 3d configurators for manufacturing companies and since it is possible to apply more than 4 morph targets to an object, this feature could now be very useful for that as well. Thanks a lot !

However, to really use it, I still have the problem that a customer of mine uses a 3d format for which I would have to develop an exporter. As I understood it, the morph targets are completely calculated in the GPU. The mesh data therefore always remains the same, no matter what influence I choose. Is it still possible to get the position of the vertices in the modified state? If it is not possible out of the box, where should I look to extend the babylonjs code for my use case ?


Hey there, you can use the getPositionData function to apply the morph on the CPU (pass true for the second parameter to apply morph) and then use setVerticesData so that the morphed vertex positions will be exported. Will prob also want to restore them afterwards. And can do the same for the normals as well. Here’s a quick example. :slight_smile:

1 Like

Welcome aboard!

You can use the AbstractMesh.getPositionData to get position data with skeleton/morph deformations applied. There’s also AbstractMesh.getNormalsData to get the modified normals.


:heavy_check_mark: Solved the issue. Thanks for your effort and the example code :slight_smile:

1 Like