From ef5d1448da31695fd682c5b6399349743c3c5717 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Thu, 10 Jul 2025 11:13:34 +0500 Subject: [PATCH] Fix is_null not updating when adding new attribute subitems #6869 --- src/bonsai/bonsai/bim/operator.py | 10 ++++++++++ 1 file changed, 10 insertions(+) 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"}