mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-11 02:02:22 +00:00
Fix is_null not updating when adding new attribute subitems #6869
This commit is contained in:
@@ -1437,6 +1437,11 @@ class BIM_OT_attribute_add_subitem(bpy.types.Operator):
|
||||
def execute(self, context) -> set["rna_enums.OperatorReturnItems"]:
|
||||
col: bpy.types.bpy_prop_collection_idprop[StrProperty]
|
||||
col = eval(self.data_path)
|
||||
|
||||
attr: "Attribute" = col.data
|
||||
if attr.is_optional and not col:
|
||||
attr.is_null = False
|
||||
|
||||
col.add()
|
||||
return {"FINISHED"}
|
||||
|
||||
@@ -1459,4 +1464,9 @@ class BIM_OT_attribute_remove_subitem(bpy.types.Operator):
|
||||
col: bpy.types.bpy_prop_collection_idprop[StrProperty]
|
||||
col = eval(self.data_path)
|
||||
col.remove(self.index)
|
||||
|
||||
attr: "Attribute" = col.data
|
||||
if attr.is_optional and not col:
|
||||
attr.is_null = True
|
||||
|
||||
return {"FINISHED"}
|
||||
|
||||
Reference in New Issue
Block a user