I require a utility that will go through each quad in a mesh, and potentially change the order of the points based on custom criteria, which will essentially change how the quad is triangulated. It is for optimizing a low polygon mesh to favor quads such that the surface looks as smooth and round as possible. So it will always favor a convex surface rather than concave. I have done this in a custom solution using OBJ files, but I would like to have a script in Blender do it so I can preserve multiple UV sets, UV pins, and other data that is blender specific.

The example scripts I found refer to the mesh.polygons collection which contains indices to the mesh.loops collection, which is read-only, so I cannot edit it.

So, given all the quads in a mesh with points {A,B,C,D}, how would I edit it in a script such that the ones that meet the criteria becomes {B,C,D,A}?

p.s. Please note that the solution I require is not quite the same as faces->triangulate faces->beauty

  • $\begingroup$ The operator add mesh and addon add object python script templates in the text editor both create a mesh from input data. Including vert indices for each face in winding order. Using these can you create an example to demonstrate how changing the order favours convexity. blender.stackexchange.com/questions/56993/… $\endgroup$
    – batFINGER
    Apr 30 '20 at 20:03
  • $\begingroup$ The issue with that approach is that I need to preserve additional data such as multiple UV's, UV pins, etc. and reconstructing the mesh would result in that information being lost. I did come up with a brute force solution that works, but will wait to see if a better solution arises before posting that info. $\endgroup$ May 1 '20 at 14:43

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.