From 2452b1be50fe29cd90bf66e2554332d4d8ec4dd1 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Tue, 21 Jan 2025 23:21:07 +1100 Subject: [PATCH] See #5973. Only show shape aspect attributes if creating a new shape aspect to make it clearer how to use the UI. Previously the UI for creating new aspects and reusing an existing aspect showed simultaneously which was confusing. --- src/bonsai/bonsai/bim/module/geometry/data.py | 2 +- src/bonsai/bonsai/bim/module/geometry/ui.py | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/bonsai/bonsai/bim/module/geometry/data.py b/src/bonsai/bonsai/bim/module/geometry/data.py index fa83a2bc33..5dc52e74a4 100644 --- a/src/bonsai/bonsai/bim/module/geometry/data.py +++ b/src/bonsai/bonsai/bim/module/geometry/data.py @@ -174,7 +174,7 @@ class RepresentationsData: matching_shape_aspects.append(shape_aspect) # blender enum items - new_shape_aspect = [("NEW", "Create A New Shape Aspect", "")] + new_shape_aspect = [("NEW", "New Shape Aspect", "")] return new_shape_aspect + [(str(s.id()), s.Name or "Unnamed", "") for s in matching_shape_aspects] diff --git a/src/bonsai/bonsai/bim/module/geometry/ui.py b/src/bonsai/bonsai/bim/module/geometry/ui.py index c691257b6d..c7ab3ddfe6 100644 --- a/src/bonsai/bonsai/bim/module/geometry/ui.py +++ b/src/bonsai/bonsai/bim/module/geometry/ui.py @@ -253,11 +253,10 @@ class BIM_PT_representation_items(Panel): row.prop(props, "representation_item_shape_aspect", icon="SHAPEKEY_DATA", text="") row.operator("bim.edit_representation_item_shape_aspect", icon="CHECKMARK", text="") row.operator("bim.disable_editing_representation_item_shape_aspect", icon="CANCEL", text="") - - shape_aspect_attrs = props.shape_aspect_attrs - self.layout.label(text="Shape Aspect Attributes:") - self.layout.prop(shape_aspect_attrs, "name") - self.layout.prop(shape_aspect_attrs, "description") + if props.representation_item_shape_aspect == "NEW": + shape_aspect_attrs = props.shape_aspect_attrs + self.layout.prop(shape_aspect_attrs, "name") + self.layout.prop(shape_aspect_attrs, "description") else: row.label(text=shape_aspect or "No Shape Aspect", icon="SHAPEKEY_DATA") row.operator("bim.enable_editing_representation_item_shape_aspect", icon="GREASEPENCIL", text="")