mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-09 09:21:46 +00:00
Add mass and time units as a panel to project wizard UI
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user