diff --git a/src/bonsai/bonsai/bim/operator.py b/src/bonsai/bonsai/bim/operator.py index f769179934..578f065b17 100644 --- a/src/bonsai/bonsai/bim/operator.py +++ b/src/bonsai/bonsai/bim/operator.py @@ -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"}