First: I have a very detailed mesh (16M tris) but there are many regions where lots of faces have the same height and angle.
An optimization approach (real time rendering is the goal) is to select a region's face, go to select linked flat faces, and unsubdivide a bunch.
That's all fine but there are hundreds of regions like this and I'd really love to lose about 5M++ tris WITHOUT doing it by hand (mind you this won't be the only mesh).
So... I really not new to programming (but to Python, which shouldn't be a problem.........) and I came up with a VERY simple, brute force algorithm to do it for me, which's pseudo-code looks like this(sorry if I use C-like syntax):
for(int i = 0; i < mesh.faces.count; i++)
{
List<face> linkedFaces = mesh.faces[i].SelectLinkedFaces(0.02f);
linkedFaces.UnSubdivide(10);
}
Well... OBVIOUSLY I don't know anything about the blender-python API. I just want to select every single face, execute the "Select linked faces" option with an angle of 0.02 degrees and then un-subdivide all faces selected that way ten times. Can anyone help me out, even if it's just a guide? Thank you!