From 3852e3c63f6c609b84d32a9c0fb48848347a9615 Mon Sep 17 00:00:00 2001 From: Dion Moult Date: Thu, 13 Mar 2025 22:06:21 +1100 Subject: [PATCH] Add tests for new light rendered shadows feature --- src/bonsai/bonsai/bim/module/light/ui.py | 1 - src/bonsai/bonsai/bim/module/style/ui.py | 4 ++-- src/bonsai/test/bim/feature/light.feature | 19 +++++++++++++++++-- 3 files changed, 19 insertions(+), 5 deletions(-) diff --git a/src/bonsai/bonsai/bim/module/light/ui.py b/src/bonsai/bonsai/bim/module/light/ui.py index 3d5a1350cf..8cbb637e06 100644 --- a/src/bonsai/bonsai/bim/module/light/ui.py +++ b/src/bonsai/bonsai/bim/module/light/ui.py @@ -236,7 +236,6 @@ class BIM_PT_solar(bpy.types.Panel): row.operator("bim.move_sun_path_to_3d_cursor") row = self.layout.row(align=True) - # row.prop(props, "display_shadows", icon="SHADING_RENDERED") row.prop(props, "shadow_mode", icon="SHADING_RENDERED", expand=True) if props.shadow_mode == "SHADING": diff --git a/src/bonsai/bonsai/bim/module/style/ui.py b/src/bonsai/bonsai/bim/module/style/ui.py index a5042fa800..e7fc9676b0 100644 --- a/src/bonsai/bonsai/bim/module/style/ui.py +++ b/src/bonsai/bonsai/bim/module/style/ui.py @@ -170,8 +170,8 @@ class BIM_PT_styles(Panel): row.prop(self.props, "reflectance_method") if self.props.reflectance_method not in ("PHYSICAL", "NOTDEFINED", "FLAT"): - self.layout.label(text=f"Supported reflectance methods are:") - self.layout.label(text=f"PHYSICAL / NOTDEFINED / FLAT") + self.layout.label(text="Supported reflectance methods are:") + self.layout.label(text="PHYSICAL / NOTDEFINED / FLAT") row = self.layout.row(align=True) row.label(text="Emissive" if self.props.reflectance_method == "FLAT" else "Diffuse") diff --git a/src/bonsai/test/bim/feature/light.feature b/src/bonsai/test/bim/feature/light.feature index d98a230b59..04559e4729 100644 --- a/src/bonsai/test/bim/feature/light.feature +++ b/src/bonsai/test/bim/feature/light.feature @@ -44,11 +44,26 @@ Scenario: Display the sun path And I set the "Sun Path Size" property to "100.0" Then nothing happens -Scenario: Display shadows +Scenario: See no shadows + Given an empty IFC project + When I look at the "Solar Access / Shadow" panel + Then I don't see "Sun Intensity" + And I don't see "Shadow Intensity" + +Scenario: Display shaded shadows Given an empty IFC project And I look at the "Solar Access / Shadow" panel - When I click "Display Shadows" + When I set the "Shadow Mode" property to "Shaded" And I set the "Shadow Intensity" property to "1.0" + And I don't see "Sun Intensity" + Then nothing happens + +Scenario: Display rendered shadows + Given an empty IFC project + And I look at the "Solar Access / Shadow" panel + When I set the "Shadow Mode" property to "Rendered" + And I set the "Sun Intensity" property to "1.0" + And I don't see "Shadow Intensity" Then nothing happens Scenario: View from sun