I have as scene with 45 objects, I am trying to write a script that will export all of the objects into separate STL files. Any ideas?
Here is a broken script I have right now:
import bpy
import os
# get the current path and make a new folder for the exported meshes
path = bpy.path.abspath('//1')
os.makedirs(path)
for object in bpy.context.selected_objects:
# deselect all meshes
bpy.ops.object.select_all(action='DESELECT')
# select the object
object.select = True
# export object with its name as file name
bpy.ops.export_mesh.stl(filepath=str((path + object.name + '.stl')), use_selection=True)
I am getting a "Python script fail, look in the console for now..." error. PS. I'm using a mac.
Thank you for your help!!!