diff --git a/core/common.py b/core/common.py index e8a89b4..9e5818e 100644 --- a/core/common.py +++ b/core/common.py @@ -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) diff --git a/functions/import_anything.py b/functions/import_anything.py index 58ed75e..96d0351 100644 --- a/functions/import_anything.py +++ b/functions/import_anything.py @@ -3,6 +3,7 @@ from bpy.types import Operator from bpy_extras.io_utils import ImportHelper from ..core.register import register_wrap from ..core.importer import imports, import_types +from ..core.common import remove_default_objects from ..functions.translations import t import pathlib import os @@ -23,7 +24,7 @@ class ImportAnyModel(Operator, ImportHelper): #since I wrote this myself, a bit more efficent than cats. mostly - @989onan def execute(self, context: bpy.types.Context): file_grouping_dict: dict[str, list[dict[str,str]]] = dict()#group our files so our importers can import them together. in the case of OBJ+MTL and others that need grouped files, this is extremely important. - + common.remove_default_objects() #check if we are importing multiple files is_multi = False try: