Download obj2glb.py from Webaverse/Stable-Dreamfusion: direct link, hf CLI and curl.
- Browser
- Download file 306 Bytes
-
https://huggingface.co/Webaverse/Stable-Dreamfusion/resolve/refs%2Fpr%2F2/obj2glb.py
- Command line
-
hf download hf://Webaverse/Stable-Dreamfusion@refs/pr/2/obj2glb.py
-
curl -L -o obj2glb.py https://huggingface.co/Webaverse/Stable-Dreamfusion/resolve/refs%2Fpr%2F2/obj2glb.py
306 Bytes
| # using blender, open an input.obj file, and export it as output.glb | |
| import bpy | |
| # import input.obj file | |
| bpy.ops.import_scene.obj(filepath='trial/mesh/mesh.obj') | |
| # select all | |
| bpy.ops.object.select_all(action='SELECT') | |
| # export output.glb file | |
| bpy.ops.export_scene.gltf(filepath="model.glb") | |
| print('done') | |