Skip to content

Instantly share code, notes, and snippets.

@mariusud
mariusud / off2obj.py
Last active July 13, 2023 13:29
Convert off to obj files in batch using blender
# Slight modification of https://gist.github.com/AngryLoki/3800594
# Converts Object File Format (OFF) files to OBJ files in batch
# Allows the usage of OFF files in Gazebo Ignition
# blender --background --python3.7 off2obj.py -- input_dir output_dir i.e. blender --background --python off2obj.py -- off_meshes/ ./obj_meshes/
# Tested with Blender 2.82 and OFF Add-on https://github.com/3Descape/blender-off-addon/tree/patch-1
# Sizes all objects down to 10,10,10
import os
import sys
import glob
import bpy