Importing now removes default cube, camera and light.

This commit is contained in:
Yusarina
2024-07-25 22:18:40 +01:00
parent 61dbd7a79f
commit bb108d28a0
2 changed files with 7 additions and 1 deletions
+5
View File
@@ -240,3 +240,8 @@ def get_shapekeys(mesh: Object, prefix: str = '') -> List[tuple]:
if not has_shapekeys(mesh):
return []
return [(key.name, key.name, key.name) for key in mesh.data.shape_keys.key_blocks if key.name != 'Basis' and key.name.startswith(prefix)]
def remove_default_objects():
for obj in bpy.data.objects:
if obj.name in ["Camera", "Light", "Cube"]:
bpy.data.objects.remove(obj, do_unlink=True)