Use property_unset instead of in and del

This commit is contained in:
Andrej730
2025-07-02 13:51:43 +05:00
parent b16fb7d917
commit 3a0a912022
3 changed files with 6 additions and 10 deletions
@@ -193,9 +193,8 @@ def update_is_adding_representation_layer(self: "BIMObjectGeometryProperties", c
return
return
if "representation_layer" in self:
del self["representation_layer"]
del self["is_adding_representation_layer"]
self.property_unset("representation_layer")
self.property_unset("is_adding_representation_layer")
def update_is_editing_item_layer(self: "BIMObjectGeometryProperties", context: bpy.types.Context) -> None:
@@ -216,9 +215,8 @@ def update_is_editing_item_layer(self: "BIMObjectGeometryProperties", context: b
self.representation_item_layer = str(layer.id())
return
if "representation_item_layer" in self:
del self["representation_item_layer"]
del self["is_editing_item_layer"]
self.property_unset("representation_item_layer")
self.property_unset("is_editing_item_layer")
class BIMObjectGeometryProperties(PropertyGroup):
+1 -2
View File
@@ -119,8 +119,7 @@ class Clash(bonsai.core.tool.Clash):
if not clash_set:
return
clash_set.clashes.clear()
if "clashes_loaded" in clash_set:
del clash_set["clashes_loaded"]
clash_set.property_unset("clashes_loaded")
@classmethod
def load_clash_sets(cls, fn: str) -> None:
+1 -2
View File
@@ -319,8 +319,7 @@ class Owner(bonsai.core.tool.Owner):
@classmethod
def clear_application(cls) -> None:
props = cls.get_owner_props()
if "active_application_id" in props:
del props["active_application_id"]
props.property_unset("active_application_id")
@classmethod
def import_application_attributes(cls) -> None: