mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-09-19 14:41:25 +00:00
Add preference for mass and time units visibility in project wizard
This commit is contained in:
@@ -359,24 +359,24 @@ 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")
|
||||||
|
|
||||||
header, body = self.layout.panel("Mass and Time Units", default_closed=True)
|
if tool.Blender.get_addon_preferences().mass_time_units_in_wizard:
|
||||||
if header:
|
header, body = self.layout.panel("Mass and Time Units", default_closed=True)
|
||||||
header.label(text="Mass and Time Units")
|
if header:
|
||||||
if body:
|
header.label(text="Mass and Time Units")
|
||||||
label = "Add Mass and Time Units" if not props.add_mass_time_units else "Remove Mass and Time Units"
|
if body:
|
||||||
body.prop(props, "add_mass_time_units", toggle=True, text=label)
|
label = "Add Mass and Time Units" if not props.add_mass_time_units else "Remove Mass and Time Units"
|
||||||
if props.add_mass_time_units:
|
body.prop(props, "add_mass_time_units", toggle=True, text=label)
|
||||||
row = body.row()
|
if props.add_mass_time_units:
|
||||||
row.prop(props, "mass_unit", text="Mass Unit")
|
row = body.row()
|
||||||
row = body.row()
|
row.prop(props, "mass_unit", text="Mass Unit")
|
||||||
row.prop(props, "time_unit", text="Time Unit")
|
row = body.row()
|
||||||
|
row.prop(props, "time_unit", text="Time Unit")
|
||||||
|
|
||||||
self.layout.use_property_split = True
|
self.layout.use_property_split = True
|
||||||
row = self.layout.row()
|
row = self.layout.row()
|
||||||
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"
|
||||||
|
|||||||
@@ -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=[
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user