()
| 18 | bpy.ops.object.mode_set(mode='OBJECT') |
| 19 | |
| 20 | def main(): |
| 21 | input_path = sys.argv[-2] |
| 22 | output_path = sys.argv[-1] |
| 23 | |
| 24 | bpy.context.preferences.system.audio_device = 'Null' |
| 25 | |
| 26 | # Clear existing scene |
| 27 | bpy.ops.wm.read_factory_settings(use_empty=True) |
| 28 | |
| 29 | # Import the OBJ file |
| 30 | bpy.ops.import_scene.obj(filepath=input_path) |
| 31 | |
| 32 | # Triangulate all imported objects |
| 33 | for obj in bpy.context.scene.objects: |
| 34 | if obj.type == 'MESH': |
| 35 | triangulate_object(obj) |
| 36 | |
| 37 | # Export the triangulated mesh to OBJ |
| 38 | bpy.ops.export_scene.obj(filepath=output_path, use_selection=False) |
| 39 | |
| 40 | if __name__ == "__main__": |
| 41 | main() |
no test coverage detected