2026-01-01
This commit is contained in:
@@ -72,3 +72,15 @@ def worlds():
|
||||
# removes all unused worlds from the project
|
||||
for world_key in unused.worlds():
|
||||
bpy.data.worlds.remove(bpy.data.worlds[world_key])
|
||||
|
||||
|
||||
def objects():
|
||||
# removes all unused objects from the project
|
||||
for object_key in unused.objects_deep():
|
||||
bpy.data.objects.remove(bpy.data.objects[object_key])
|
||||
|
||||
|
||||
def armatures():
|
||||
# removes all unused armatures from the project
|
||||
for armature_key in unused.armatures_deep():
|
||||
bpy.data.armatures.remove(bpy.data.armatures[armature_key])
|
||||
|
||||
@@ -24,11 +24,18 @@ data categories.
|
||||
"""
|
||||
|
||||
import bpy
|
||||
from ...utils import compat
|
||||
|
||||
|
||||
def nuke_data(data):
|
||||
# removes all data-blocks from the indicated set of data
|
||||
# Skip library-linked and override datablocks
|
||||
keys_to_remove = []
|
||||
for key in data.keys():
|
||||
datablock = data[key]
|
||||
if not compat.is_library_or_override(datablock):
|
||||
keys_to_remove.append(key)
|
||||
for key in keys_to_remove:
|
||||
data.remove(data[key])
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user