Skip to content

Instantly share code, notes, and snippets.

@micahscopes
Last active April 14, 2022 11:33
Show Gist options
  • Save micahscopes/6176139 to your computer and use it in GitHub Desktop.
Save micahscopes/6176139 to your computer and use it in GitHub Desktop.
Batch import a folder of Wavefront OBJ files to Blender. It used to be that you could do this with the built-in OBJ import/export script, but I've been getting an error with that. Here's a workaround.
import os
import bpy
path_to_dir = "/directory/full/of/obj/files/"
files_in_dir = os.listdir(path_to_dir)
for file_in_dir in files_in_dir:
bpy.ops.import_scene.obj(filepath=path_to_dir+file_in_dir)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment