mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 18:16:40 +00:00
Fix #2370. Asset preview code did not clean up after itself properly after generating objects.
This commit is contained in:
@@ -148,8 +148,14 @@ class AuthoringData:
|
||||
cls.data["preview_constr_types"][ifc_class] = {}
|
||||
cls.data["preview_constr_types"][ifc_class][str(relating_type_id)] = {"icon_id": icon_id, "object": obj}
|
||||
if to_be_deleted:
|
||||
for col in obj.users_collection:
|
||||
col.objects.unlink(obj)
|
||||
element = tool.Ifc.get_entity(obj)
|
||||
if element:
|
||||
tool.Ifc.delete(element)
|
||||
tool.Ifc.unlink(obj=obj)
|
||||
# We do not delete the object from the scene, as that breaks Blender's asset system.
|
||||
# Instead, we only "hide" it by unlinking it from all collections.
|
||||
for collection in obj.users_collection:
|
||||
collection.objects.unlink(obj)
|
||||
|
||||
@classmethod
|
||||
def assetize_relating_type_from_selection(cls, browser=False):
|
||||
|
||||
Reference in New Issue
Block a user