From 53da438b23823128b5731ae96783dc8d7d2cef1b Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Mon, 27 Nov 2023 12:21:29 +0500 Subject: [PATCH] Small styles UI tweaks - fixed a typo in bim.select_by_style - added note to clarify what Shade/Render/Texture/Lighting/etc buttons do and moved style selection block at the beggining (maybe it's just me but when edit buttons are above selection ui it seemed like they affect all the styles somehow, not just the currently active one), so it will be more intuitive Before: https://i.imgur.com/jRSTLGI.png After: https://i.imgur.com/8ih4qSX.png --- src/blenderbim/blenderbim/bim/module/style/operator.py | 2 +- src/blenderbim/blenderbim/bim/module/style/ui.py | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/blenderbim/blenderbim/bim/module/style/operator.py b/src/blenderbim/blenderbim/bim/module/style/operator.py index 8f22db9034..66363c40dc 100644 --- a/src/blenderbim/blenderbim/bim/module/style/operator.py +++ b/src/blenderbim/blenderbim/bim/module/style/operator.py @@ -401,7 +401,7 @@ class LoadStyles(bpy.types.Operator, tool.Ifc.Operator): class SelectByStyle(bpy.types.Operator, tool.Ifc.Operator): bl_idname = "bim.select_by_style" - bl_label = "Select By Material" + bl_label = "Select By Style" bl_options = {"REGISTER", "UNDO"} style: bpy.props.IntProperty() diff --git a/src/blenderbim/blenderbim/bim/module/style/ui.py b/src/blenderbim/blenderbim/bim/module/style/ui.py index 9d1b54f7df..a02fb78d17 100644 --- a/src/blenderbim/blenderbim/bim/module/style/ui.py +++ b/src/blenderbim/blenderbim/bim/module/style/ui.py @@ -57,6 +57,8 @@ class BIM_PT_styles(Panel): row.operator("bim.load_styles", text="", icon="IMPORT").style_type = self.props.style_type return + self.layout.template_list("BIM_UL_styles", "", self.props, "styles", self.props, "active_style_index") + if self.props.is_adding: box = self.layout.box() row = box.row() @@ -80,6 +82,7 @@ class BIM_PT_styles(Panel): row.operator("bim.remove_style", text="", icon="X").style = style.ifc_definition_id if self.props.style_type == "IfcSurfaceStyle": + self.layout.label(text="Choose current style's aspect to edit:") col = self.layout.column(align=True) row = col.row(align=True) @@ -104,8 +107,6 @@ class BIM_PT_styles(Panel): op.ifc_class = "IfcExternallyDefinedSurfaceStyle" op.style = style.ifc_definition_id - self.layout.template_list("BIM_UL_styles", "", self.props, "styles", self.props, "active_style_index") - if self.props.is_editing_style: if self.props.is_editing_class == "IfcSurfaceStyle": blenderbim.bim.helper.draw_attributes(self.props.attributes, self.layout) @@ -118,6 +119,9 @@ class BIM_PT_styles(Panel): self.draw_surface_style_rendering() elif self.props.is_editing_class == "IfcExternallyDefinedSurfaceStyle": self.draw_externally_defined_surface_style() + else: + # TODO: UI for Texture, Lighting, Refract + self.layout.label(text=f"{self.props.is_editing_class} UI is not yet supported.") def draw_surface_style_shading(self): row = self.layout.row()