Converting To Triangles


From within Blender it’s possible to convert faces to triangles. Is there any way to execute this function from a python script? The closest thing I could find was the Mesh function quadToTriangle but since faces can be a polygon of any number of vertices I’m assuming this is not the right function?

The assumption that a polygon can have any number of verts is wrong. In Blender you can only have qauds or tris, so this is indeed the function you want.

At least at this point of Blender development. Future might brings strange new things.

2035 we will get NGONs?

blender may never get true ngons, and the fgons arnt directly supported in python - only via the edge flag.

if you want to remove fgons…

for ed in me.edges: ed.flag &= ~Mesh.EdgeFlag.FGON

check the docs for exact var names

I’ve been trying use quadToTriangle without any success.

I get an “attribute error” when I try “mesh.quadToTriangle(0)”, and I’m finding a suprisingly small amount of information on it.

Before I dig too much into it: Has anyone had success with it? In the docs it says “Experimental”, which I have a feeling may mean “Temperamental”. :wink:


are you sure the mesh is a mesh?

also select and unhide all
mesh.hide = 0
mesh.sel = 1