Script for loading Multiple objs in Blender

import os
import bpy

full_path_to_directory = os.path.join('C:\\', 'Users', 'name', 'Documents', 'OBJECTS')

# get list of all files in directory
file_list = os.listdir(full_path_to_directory)

# reduce the list to files ending in 'obj'
# using 'list comprehensions'
obj_list = [item for item in file_list if item[-3:] == 'obj']

# loop through the strings in obj_list.
for item in obj_list:
    full_path_to_file = os.path.join(full_path_to_directory, item)
    bpy.ops.import_scene.obj(filepath=full_path_to_file)

Taken fromĀ here

Advertisements