From 3617d119cbf7c307d6970f8fe2b0ee1207b84082 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Wed, 5 Nov 2025 17:57:55 +0500 Subject: [PATCH] Fix breaking old stair generation tests after f52aafd Before f52aafd default `(0,0)` meant that there are no custom tread runs, but after the change it actually means that runs for first and last treads are 0. So default value should be adjusted. Added explicit `None` value for clarity. --- src/bonsai/bonsai/bim/module/model/prop.py | 6 ++++-- src/bonsai/bonsai/tool/model.py | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/bonsai/bonsai/bim/module/model/prop.py b/src/bonsai/bonsai/bim/module/model/prop.py index b83b3e26cd..e27d72a11d 100644 --- a/src/bonsai/bonsai/bim/module/model/prop.py +++ b/src/bonsai/bonsai/bim/module/model/prop.py @@ -608,16 +608,18 @@ class BIMStairProperties(PropertyGroup): } stair_kwargs.update(generic_props) + non_si_units_props = self.non_si_units_props # If locked, use tread_run for both first and last treads if self.custom_tread_lock: - stair_kwargs["custom_first_last_tread_run"] = (self.tread_run, self.tread_run) + non_si_units_props += ("custom_first_last_tread_run",) + stair_kwargs["custom_first_last_tread_run"] = (None, None) else: stair_kwargs["custom_first_last_tread_run"] = self.custom_first_last_tread_run if not convert_to_project_units: return stair_kwargs - stair_kwargs = tool.Model.convert_data_to_project_units(stair_kwargs, self.non_si_units_props) + stair_kwargs = tool.Model.convert_data_to_project_units(stair_kwargs, non_si_units_props) return stair_kwargs def get_props_kwargs_for_ifc_export(self, convert_to_project_units=False, stair_type=None): diff --git a/src/bonsai/bonsai/tool/model.py b/src/bonsai/bonsai/tool/model.py index 324b548c6e..1867b2d1f8 100644 --- a/src/bonsai/bonsai/tool/model.py +++ b/src/bonsai/bonsai/tool/model.py @@ -1398,7 +1398,7 @@ class Model(bonsai.core.tool.Model): has_top_nib=None, top_slab_depth=None, base_slab_depth=None, - custom_first_last_tread_run=(0, 0), + custom_first_last_tread_run: Union[tuple[float, float], tuple[None, None]] = (None, None), nosing_length=0, # CONCRETE GENERIC STAIR ARGUMENTS nosing_depth=0,