diff --git a/io_mesh_ply/export_ply.py b/io_mesh_ply/export_ply.py index 060b3d02eb84cdefdbdaf0664afca2169918f618..e86f43f3b4d152b26dacfbeb8d4b4971c8d1c3bc 100644 --- a/io_mesh_ply/export_ply.py +++ b/io_mesh_ply/export_ply.py @@ -244,6 +244,10 @@ def save( bm.from_mesh(me) ob_eval.to_mesh_clear() + # Workaround for hardcoded unsigned char limit in other DCCs PLY importers + if (ngons := [f for f in bm.faces if len(f.verts) > 255]): + bmesh.ops.triangulate(bm, faces=ngons) + mesh = bpy.data.meshes.new("TMP PLY EXPORT") bm.to_mesh(mesh) bm.free()