| 2 | import sys |
| 3 | |
| 4 | def triangulate_object(obj): |
| 5 | bpy.ops.object.select_all(action='DESELECT') |
| 6 | obj.select_set(True) |
| 7 | # Select the object |
| 8 | bpy.context.view_layer.objects.active = obj |
| 9 | # Switch to object mode |
| 10 | bpy.ops.object.mode_set(mode='OBJECT') |
| 11 | # Switch to edit mode |
| 12 | bpy.ops.object.mode_set(mode='EDIT') |
| 13 | # Select all faces |
| 14 | bpy.ops.mesh.select_all(action='SELECT') |
| 15 | # Triangulate the mesh |
| 16 | bpy.ops.mesh.quads_convert_to_tris() |
| 17 | # Switch back to object mode |
| 18 | bpy.ops.object.mode_set(mode='OBJECT') |
| 19 | |
| 20 | def main(): |
| 21 | input_path = sys.argv[-2] |