feat: move clean_scene to uils

This commit is contained in:
Swann Martinez
2019-08-08 14:46:59 +02:00
parent fefa7ec13e
commit 69472328d5
4 changed files with 25 additions and 27 deletions

View File

@ -70,7 +70,15 @@ def get_selected_objects(scene):
return selected_objects
def clean_scene(elements=environment.rtypes):
for datablock in BPY_TYPES:
datablock_ref = getattr(bpy.data, BPY_TYPES[datablock])
for item in datablock_ref:
try:
datablock_ref.remove(item)
# Catch last scene remove
except RuntimeError:
pass
# LOAD HELPERS
def load(key, value):
target = resolve_bpy_path(key)