I’m trying to export all vertex assigned to a vertex group as triangles, in other words im trying to split the mesh in multiple objects based on the vertex group they are assigned. But I can’t seems to find a way to do so since the best I can get is mesh.getVertsFromGroup and that only return me the indices, and what Im trying to get is all the triangles assigned to a vertex group. Is there other ways I can do this?
The idea is to export every triangles related to their vertexgroup (that is linked based on bones) into multiple geometry, and by getting the matrix of the bones at the certain point in time I can animate theses specific triangles based on which vertex group they are belong to related to their assigned bones.
I already have all the code for extracting the bones, action and matrices… but now Im stuck with that vertexgroup triangle export…
Please help Im really stuck, I tried many things but can’t seems to find a way to do it.
If you don’t care about edge order, then you can copy the mesh (or work on the original if you don’t mind it getting messed up), then select all the vertexes (via python or manually), and then call quadToTriangle().
From there, you can just grab the vertexes that are given by the indexes in the vertex group and export their location and how faces are built.
Or do you only want the triangles, not all the faces?
I need to know how the triangles are assembled, cuz basically the final result of my export is going straight into a VBO. So my engine don’t spend time reconstructing anything. So basically when Im animating the mesh I just have to apply the matrix on the set of triangles assigned to the bones using the vertexgroup in blender and simply interpolate the bone matrix among the frames et voila.
It is critical that I know the triangles construction from blender.