diff --git a/src/bonsai/bonsai/bim/module/project/__init__.py b/src/bonsai/bonsai/bim/module/project/__init__.py index 1316eb0325..7e1bdb7ff0 100644 --- a/src/bonsai/bonsai/bim/module/project/__init__.py +++ b/src/bonsai/bonsai/bim/module/project/__init__.py @@ -114,6 +114,7 @@ def register(): kmi = km.keymap_items.new("bim.save_project", "S", "PRESS", ctrl=True) kmi.properties.should_save_as = False addon_keymaps.append((km, kmi)) + bpy.utils.register_class(ui.BIM_PT_mass_time_units) def unregister(): @@ -131,3 +132,4 @@ def unregister(): for km, kmi in addon_keymaps: km.keymap_items.remove(kmi) addon_keymaps.clear() + bpy.utils.unregister_class(ui.BIM_PT_mass_time_units) diff --git a/src/bonsai/bonsai/bim/module/project/ui.py b/src/bonsai/bonsai/bim/module/project/ui.py index ed6e65e674..f1b087e34b 100644 --- a/src/bonsai/bonsai/bim/module/project/ui.py +++ b/src/bonsai/bonsai/bim/module/project/ui.py @@ -358,19 +358,30 @@ class BIM_PT_new_project_wizard(Panel): row.prop(props, "volume_unit", text="Volume Unit") row = self.layout.row() prop_with_search(self.layout, pprops, "template_file", text="Template") - self.layout.use_property_split = False - row = self.layout.row() - label = "Add Mass and Time Units" if not props.add_mass_time_units else "Remove Mass and Time Units" - row.prop(props, "add_mass_time_units", toggle=True, text=label) self.layout.use_property_split = True - if props.add_mass_time_units: - row = self.layout.row() - row.prop(props, "mass_unit", text="Mass Unit") - row = self.layout.row() - row.prop(props, "time_unit", text="Time Unit") row = self.layout.row() row.operator("bim.create_project") +class BIM_PT_mass_time_units(Panel): + bl_label = "Mass and Time Units" + bl_idname = "BIM_PT_mass_time_units" + bl_options = {"DEFAULT_CLOSED"} + bl_space_type = "PROPERTIES" + bl_region_type = "WINDOW" + bl_context = "scene" + bl_parent_id = "BIM_PT_new_project_wizard" + + def draw(self, context): + layout = self.layout + props = tool.Blender.get_bim_props() + label = "Add Mass and Time Units" if not props.add_mass_time_units else "Remove Mass and Time Units" + layout.prop(props, "add_mass_time_units", toggle=True, text=label) + if props.add_mass_time_units: + row = layout.row() + row.prop(props, "mass_unit", text="Mass Unit") + row = layout.row() + row.prop(props, "time_unit", text="Time Unit") + class BIM_PT_project_library(Panel): bl_label = "Project Library" bl_idname = "BIM_PT_project_library"