Last active
May 21, 2023 19:14
-
-
Save p2or/7a543dd8cb3cc535d6a382d464391008 to your computer and use it in GitHub Desktop.
Del Save Reopen #Blender
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
# http://blender.stackexchange.com/q/75310/3710 | |
import bpy | |
# select all mesh objects | |
for o in bpy.data.objects: | |
if o.type == 'MESH': | |
o.select = True | |
else: | |
o.select = False | |
# call the operator one time | |
bpy.ops.object.delete() | |
# save and re-open to clean up the data blocks | |
bpy.ops.wm.save_as_mainfile(filepath=bpy.data.filepath) | |
bpy.ops.wm.open_mainfile(filepath=bpy.data.filepath) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment