Created
November 12, 2019 01:03
-
-
Save ajshort/a512012257aad5f3f24a0d049f15a2f9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
selection = bpy.context.selected_objects | |
# Export each object. | |
for object in selection: | |
if object.type != 'MESH': | |
continue | |
bpy.ops.object.select_all(action='DESELECT') | |
object.select_set(True) | |
print('Exporting {}'.format(object.name)) | |
bpy.ops.export_mesh.stl(filepath='/home/ajshort/export/{}.stl'.format(object.name), | |
use_selection=True) | |
# Reset the selection to original. | |
bpy.ops.object.select_all(action='DESELECT') | |
for object in selection: | |
object.select_set(True) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment