Add preference for mass and time units visibility in project wizard

This commit is contained in:
falken10vdl
2025-12-15 13:39:46 +01:00
parent a98cad161e
commit 5294fa1cbe
3 changed files with 21 additions and 13 deletions
+1 -1
View File
@@ -359,6 +359,7 @@ class BIM_PT_new_project_wizard(Panel):
row = self.layout.row() row = self.layout.row()
prop_with_search(self.layout, pprops, "template_file", text="Template") prop_with_search(self.layout, pprops, "template_file", text="Template")
if tool.Blender.get_addon_preferences().mass_time_units_in_wizard:
header, body = self.layout.panel("Mass and Time Units", default_closed=True) header, body = self.layout.panel("Mass and Time Units", default_closed=True)
if header: if header:
header.label(text="Mass and Time Units") header.label(text="Mass and Time Units")
@@ -376,7 +377,6 @@ class BIM_PT_new_project_wizard(Panel):
row.operator("bim.create_project") row.operator("bim.create_project")
class BIM_PT_project_library(Panel): class BIM_PT_project_library(Panel):
bl_label = "Project Library" bl_label = "Project Library"
bl_idname = "BIM_PT_project_library" bl_idname = "BIM_PT_project_library"
+1 -1
View File
@@ -589,7 +589,7 @@ class BIMProperties(PropertyGroup):
add_mass_time_units: bpy.props.BoolProperty( add_mass_time_units: bpy.props.BoolProperty(
name="Add Mass and Time Units", name="Add Mass and Time Units",
description="Enable to define mass and time units for the project", description="Enable to define mass and time units for the project",
default=False default=False,
) )
mass_unit: EnumProperty( mass_unit: EnumProperty(
items=[ items=[
+8
View File
@@ -684,6 +684,12 @@ class BIM_ADDON_preferences(bpy.types.AddonPreferences):
default=False, default=False,
) )
mass_time_units_in_wizard: BoolProperty(
name="Mass and time units in project wizard",
description="Show mass and time units section in the new project wizard panel",
default=False,
)
if TYPE_CHECKING: if TYPE_CHECKING:
svg2pdf_command: str svg2pdf_command: str
svg2dxf_command: str svg2dxf_command: str
@@ -720,6 +726,7 @@ class BIM_ADDON_preferences(bpy.types.AddonPreferences):
doc: DocPreferences doc: DocPreferences
default_parameters: DefaultParameters default_parameters: DefaultParameters
container_hide_show_isolate: bool container_hide_show_isolate: bool
mass_time_units_in_wizard: bool
def draw(self, context: bpy.types.Context) -> None: def draw(self, context: bpy.types.Context) -> None:
layout = self.layout layout = self.layout
@@ -901,6 +908,7 @@ class BIM_ADDON_preferences(bpy.types.AddonPreferences):
def draw_extras_settings(self, layout: bpy.types.UILayout, context: bpy.types.Context) -> None: def draw_extras_settings(self, layout: bpy.types.UILayout, context: bpy.types.Context) -> None:
layout.prop(self, "container_hide_show_isolate") layout.prop(self, "container_hide_show_isolate")
layout.prop(self, "mass_time_units_in_wizard")
# Scene panel groups # Scene panel groups