MCPcopy Create free account
hub / github.com/TEA-Lab/TwoByTwo / main

Function main

data_util/blender_triangulate.py:20–38  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

18 bpy.ops.object.mode_set(mode='OBJECT')
19
20def 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
40if __name__ == "__main__":
41 main()

Callers 1

Calls 1

triangulate_objectFunction · 0.85

Tested by

no test coverage detected