black format

This commit is contained in:
Andrej730
2024-09-09 17:59:48 +05:00
parent e87faa167c
commit e7ad71b51d
3 changed files with 82 additions and 217 deletions
+1 -3
View File
@@ -647,9 +647,7 @@ class MEPAddObstruction(bpy.types.Operator, tool.Ifc.Operator):
class MEPAddTransition(bpy.types.Operator, tool.Ifc.Operator):
bl_idname = "bim.mep_add_transition"
bl_label = "Add Transition"
bl_description = (
"Adds transition between two selected MEP Elements"
)
bl_description = "Adds transition between two selected MEP Elements"
bl_options = {"REGISTER", "UNDO"}
start_length: bpy.props.FloatProperty(
name="Start Length", description="Transition start length in SI units", default=0.1, subtype="DISTANCE", min=0
+80 -213
View File
@@ -370,11 +370,7 @@ class BimToolUI:
row = cls.layout.row(align=True)
row.prop(data=cls.props, property="rl2", text="RL")
elif cls.props.ifc_class in ("IfcSpaceType"):
add_layout_hotkey_operator(
cls.layout,
"Generate",
"S_G",
"Generate a space at the cursor position")
add_layout_hotkey_operator(cls.layout, "Generate", "S_G", "Generate a space at the cursor position")
else:
row = cls.layout.row(align=True)
row.prop(data=cls.props, property="rl_mode", text="RL")
@@ -400,12 +396,7 @@ class BimToolUI:
cls.layout.separator()
add_layout_hotkey_operator(
cls.layout,
"Regen",
"S_G",
"Regenerate selected Element",
ui_context)
add_layout_hotkey_operator(cls.layout, "Regen", "S_G", "Regenerate selected Element", ui_context)
cls.layout.separator()
@@ -437,48 +428,36 @@ class BimToolUI:
)
cls.layout.separator()
add_layout_hotkey_operator(
cls.layout,
"Merge",
"S_M",
"Merge selected Elements",
ui_context)
add_layout_hotkey_operator(cls.layout, "Merge", "S_M", "Merge selected Elements", ui_context)
add_layout_hotkey_operator(
cls.layout,
"Split",
"S_K",
"Split selected Element into two Elements at the cursor location",
ui_context)
ui_context,
)
add_layout_hotkey_operator(
cls.layout,
"Rotate 90",
"S_R",
"Rotate the selected Element by 90 degrees",
ui_context)
cls.layout, "Rotate 90", "S_R", "Rotate the selected Element by 90 degrees", ui_context
)
add_layout_hotkey_operator(
cls.layout,
"Flip",
"S_F",
"Flip Element about its local axes, keep the position",
ui_context)
cls.layout, "Flip", "S_F", "Flip Element about its local axes, keep the position", ui_context
)
# row.operator("bim.unjoin_walls", icon="X", text="")
elif AuthoringData.data["active_material_usage"] == "LAYER3":
if len(context.selected_objects) == 1:
add_layout_hotkey_operator(
cls.layout,
"Edit Profile",
"S_E",
"Edit associated Profile Element",
ui_context)
cls.layout, "Edit Profile", "S_E", "Edit associated Profile Element", ui_context
)
elif "LAYER2" in AuthoringData.data["selected_material_usages"]:
add_layout_hotkey_operator(
cls.layout,
"Extend Wall To Slab",
"S_E",
"Extend the selected Wall to the selected Slab",
ui_context)
ui_context,
)
row = cls.layout.row(align=True)
row.prop(data=cls.props, property="x_angle", text="Angle")
@@ -507,11 +486,8 @@ class BimToolUI:
ui_context,
)
add_layout_hotkey_operator(
cls.layout,
"Flip",
"S_F",
"Flip object about its local axes, keep the position",
ui_context)
cls.layout, "Flip", "S_F", "Flip object about its local axes, keep the position", ui_context
)
if AuthoringData.data["active_class"] in (
"IfcCableCarrierSegment",
@@ -525,7 +501,8 @@ class BimToolUI:
"Add Fitting",
"S_Y",
"Add a Fitting based on currently selected Elements and cursor",
ui_context)
ui_context,
)
cls.layout.operator("bim.mep_add_bend")
cls.layout.operator("bim.mep_add_transition")
cls.layout.operator("bim.mep_add_obstruction")
@@ -553,18 +530,9 @@ class BimToolUI:
ui_context,
)
add_layout_hotkey_operator(
cls.layout,
"Rotate 90",
"S_R",
"Rotate the selected element by 90 degrees",
ui_context)
add_layout_hotkey_operator(
cls.layout,
"Regen",
"S_G",
"Regenerate selected element",
ui_context
cls.layout, "Rotate 90", "S_R", "Rotate the selected element by 90 degrees", ui_context
)
add_layout_hotkey_operator(cls.layout, "Regen", "S_G", "Regenerate selected element", ui_context)
row.operator("bim.extend_profile", icon="X", text="").join_type = ""
elif (
@@ -589,35 +557,19 @@ class BimToolUI:
row = cls.layout.row(align=True)
row.prop(data=cls.props, property="rl1", text="RL")
add_layout_hotkey_operator(cls.layout, "Regen", "S_G", "Regenerate selected Element", ui_context)
add_layout_hotkey_operator(
cls.layout,
"Regen",
"S_G",
"Regenerate selected Element",
ui_context)
add_layout_hotkey_operator(
cls.layout,
"Flip",
"S_F",
"Flip object about its local axes, keep the position",
ui_context)
cls.layout, "Flip", "S_F", "Flip object about its local axes, keep the position", ui_context
)
elif AuthoringData.data["active_representation_type"] == "SweptSolid":
if not tool.Model.is_parametric_window_active() and not tool.Model.is_parametric_door_active():
add_layout_hotkey_operator(
cls.layout,
"Edit Profile",
"S_E",
"Edit assosiated Profile Element",
ui_context)
cls.layout, "Edit Profile", "S_E", "Edit assosiated Profile Element", ui_context
)
elif AuthoringData.data["active_class"] in ("IfcSpace",):
add_layout_hotkey_operator(
cls.layout,
"Regen",
"S_G",
"Regenerate selected Space",
ui_context)
add_layout_hotkey_operator(cls.layout, "Regen", "S_G", "Regenerate selected Space", ui_context)
elif tool.Model.is_parametric_roof_active() and not context.active_object.BIMRoofProperties.is_editing_path:
row = cls.layout.row(align=True)
@@ -630,7 +582,7 @@ class BimToolUI:
"Regen MEP",
"S_G",
"Regenerates the positions and segment lengths of a distribution element and all connected elements",
ui_context
ui_context,
)
cls.layout.operator("bim.mep_connect_elements")
@@ -665,54 +617,39 @@ class BimToolUI:
"Exterior",
"S_X",
"Align selected Elements to the Exterior of the last selected object",
ui_context)
ui_context,
)
add_layout_hotkey_operator(
cls.layout,
"Centerline",
"S_C",
"Align selected Elements to the Centerline of the last selected object",
ui_context)
ui_context,
)
add_layout_hotkey_operator(
cls.layout,
"Interior",
"S_V",
"Align selected Elements to the Interior of the last selected object",
ui_context)
ui_context,
)
add_layout_hotkey_operator(
cls.layout,
"Mirror",
"S_M",
"Mirrors the selected Elements along a mirror plane set by the last selected object",
ui_context)
ui_context,
)
cls.layout.row(align=True).label(text="Mode")
add_layout_hotkey_operator(
cls.layout,
"Opening",
"A_O",
"Toggle display of Openings in the selected Elements",
ui_context)
add_layout_hotkey_operator(
cls.layout,
"Decomposition",
"A_D",
"Select decomposition",
ui_context)
cls.layout, "Opening", "A_O", "Toggle display of Openings in the selected Elements", ui_context
)
add_layout_hotkey_operator(cls.layout, "Decomposition", "A_D", "Select decomposition", ui_context)
cls.layout.row(align=True).label(text="Aggregation")
add_layout_hotkey_operator(
cls.layout,
"Assign",
"C_P",
"Assign element to Aggregation",
ui_context)
add_layout_hotkey_operator(
cls.layout,
"Unassign",
"A_P",
"Unassign element from Aggregation",
ui_context
)
add_layout_hotkey_operator(cls.layout, "Assign", "C_P", "Assign element to Aggregation", ui_context)
add_layout_hotkey_operator(cls.layout, "Unassign", "A_P", "Unassign element from Aggregation", ui_context)
cls.layout.row(align=True).label(text="Qto")
add_layout_hotkey_operator(
@@ -720,7 +657,7 @@ class BimToolUI:
"Perform Quantity Take-off",
"S_Q",
"Perform a quantity take off on selected objects based of a QTO rule configuration",
ui_context
ui_context,
)
@classmethod
@@ -743,12 +680,7 @@ class BimToolUI:
op.x_angle = cls.props.x_angle
row = cls.layout.row()
add_layout_hotkey_operator(
row,
"Regen",
"S_G",
"Regenerate selected Element",
ui_context)
add_layout_hotkey_operator(row, "Regen", "S_G", "Regenerate selected Element", ui_context)
row = cls.layout.row(align=True)
add_layout_hotkey_operator(
@@ -775,46 +707,28 @@ class BimToolUI:
row.operator("bim.unjoin_walls", text="", icon_value=custom_icon_previews["UNJOIN_WALLS"].icon_id)
row = cls.layout.row(align=True)
add_layout_hotkey_operator(row, "Merge", "S_M", "Merge selected Elements", ui_context)
add_layout_hotkey_operator(
row,
"Merge",
"S_M",
"Merge selected Elements",
ui_context)
row, "Split", "S_K", "Split selected Element into two Elements at the cursor location", ui_context
)
add_layout_hotkey_operator(row, "Rotate 90", "S_R", "Rotate the selected Element by 90 degrees", ui_context)
add_layout_hotkey_operator(
row,
"Split",
"S_K",
"Split selected Element into two Elements at the cursor location",
ui_context)
add_layout_hotkey_operator(
row,
"Rotate 90",
"S_R",
"Rotate the selected Element by 90 degrees",
ui_context)
add_layout_hotkey_operator(
row,
"Flip",
"S_F",
"Flip Element about its local axes, keep the position",
ui_context)
row, "Flip", "S_F", "Flip Element about its local axes, keep the position", ui_context
)
elif AuthoringData.data["active_material_usage"] == "LAYER3":
if len(context.selected_objects) == 1:
add_layout_hotkey_operator(
cls.layout,
"Edit Profile",
"S_E",
"Edit associated Profile Element",
ui_context)
cls.layout, "Edit Profile", "S_E", "Edit associated Profile Element", ui_context
)
elif "LAYER2" in AuthoringData.data["selected_material_usages"]:
add_layout_hotkey_operator(
cls.layout,
"Extend Wall To Slab",
"S_E",
"Extend the selected Wall to the selected Slab",
ui_context)
ui_context,
)
row = cls.layout.row(align=True)
row.prop(data=cls.props, property="x_angle", text="Angle")
@@ -843,11 +757,8 @@ class BimToolUI:
ui_context,
)
add_layout_hotkey_operator(
cls.layout,
"Flip",
"S_F",
"Flip object about its local axes, keep the position",
ui_context)
cls.layout, "Flip", "S_F", "Flip object about its local axes, keep the position", ui_context
)
if AuthoringData.data["active_class"] in (
"IfcCableCarrierSegment",
@@ -861,7 +772,8 @@ class BimToolUI:
"Add Fitting",
"S_Y",
"Add a Fitting based on currently selected Elements and cursor",
ui_context)
ui_context,
)
if context.region.type != "TOOL_HEADER":
cls.layout.operator("bim.mep_add_bend")
cls.layout.operator("bim.mep_add_transition")
@@ -890,18 +802,9 @@ class BimToolUI:
ui_context,
)
add_layout_hotkey_operator(
cls.layout,
"Rotate 90",
"S_R",
"Rotate the selected element by 90 degrees",
ui_context)
add_layout_hotkey_operator(
cls.layout,
"Regen",
"S_G",
"Regenerate selected element",
ui_context
cls.layout, "Rotate 90", "S_R", "Rotate the selected element by 90 degrees", ui_context
)
add_layout_hotkey_operator(cls.layout, "Regen", "S_G", "Regenerate selected element", ui_context)
row.operator("bim.extend_profile", icon="X", text="").join_type = ""
elif (
@@ -926,35 +829,19 @@ class BimToolUI:
row = cls.layout.row(align=True)
row.prop(data=cls.props, property="rl1", text="RL")
add_layout_hotkey_operator(cls.layout, "Regen", "S_G", "Regenerate selected Element", ui_context)
add_layout_hotkey_operator(
cls.layout,
"Regen",
"S_G",
"Regenerate selected Element",
ui_context)
add_layout_hotkey_operator(
cls.layout,
"Flip",
"S_F",
"Flip object about its local axes, keep the position",
ui_context)
cls.layout, "Flip", "S_F", "Flip object about its local axes, keep the position", ui_context
)
elif AuthoringData.data["active_representation_type"] == "SweptSolid":
if not tool.Model.is_parametric_window_active() and not tool.Model.is_parametric_door_active():
add_layout_hotkey_operator(
cls.layout,
"Edit Profile",
"S_E",
"Edit assosiated Profile Element",
ui_context)
cls.layout, "Edit Profile", "S_E", "Edit assosiated Profile Element", ui_context
)
elif AuthoringData.data["active_class"] in ("IfcSpace",):
add_layout_hotkey_operator(
cls.layout,
"Regen",
"S_G",
"Regenerate selected Space",
ui_context)
add_layout_hotkey_operator(cls.layout, "Regen", "S_G", "Regenerate selected Space", ui_context)
elif tool.Model.is_parametric_roof_active() and not context.active_object.BIMRoofProperties.is_editing_path:
row = cls.layout.row(align=True)
@@ -967,7 +854,8 @@ class BimToolUI:
"Regen MEP",
"S_G",
"Regenerates the positions and segment lengths of a distribution element and all connected elements",
ui_context)
ui_context,
)
cls.layout.operator("bim.mep_connect_elements")
row = cls.layout.row(align=True)
@@ -993,57 +881,35 @@ class BimToolUI:
row = cls.layout.row(align=True)
add_layout_hotkey_operator(
row,
"Exterior",
"S_X",
"Align selected Elements to the Exterior of the last selected object",
ui_context)
row, "Exterior", "S_X", "Align selected Elements to the Exterior of the last selected object", ui_context
)
add_layout_hotkey_operator(
row,
"Centerline",
"S_C",
"Align selected Elements to the Centerline of the last selected object",
ui_context)
ui_context,
)
add_layout_hotkey_operator(
row,
"Interior",
"S_V",
"Align selected Elements to the Interior of the last selected object",
ui_context)
row, "Interior", "S_V", "Align selected Elements to the Interior of the last selected object", ui_context
)
add_layout_hotkey_operator(
row,
"Mirror",
"S_M",
"Mirrors the selected Elements along a mirror plane set by the last selected object",
ui_context)
ui_context,
)
row = cls.layout.row(align=True)
add_layout_hotkey_operator(
row,
"Opening",
"A_O",
"Toggle display of Openings in the selected Elements",
ui_context)
add_layout_hotkey_operator(
row,
"Decomposition",
"A_D",
"Select decomposition",
ui_context)
row, "Opening", "A_O", "Toggle display of Openings in the selected Elements", ui_context
)
add_layout_hotkey_operator(row, "Decomposition", "A_D", "Select decomposition", ui_context)
row = cls.layout.row(align=True)
add_layout_hotkey_operator(
row,
"Assign",
"C_P",
"Assign element to Aggregation",
ui_context)
add_layout_hotkey_operator(
row,
"Unassign",
"A_P",
"Unassign element from Aggregation",
ui_context)
add_layout_hotkey_operator(row, "Assign", "C_P", "Assign element to Aggregation", ui_context)
add_layout_hotkey_operator(row, "Unassign", "A_P", "Unassign element from Aggregation", ui_context)
row = cls.layout.row()
add_layout_hotkey_operator(
@@ -1051,7 +917,8 @@ class BimToolUI:
"Perform Quantity Take-off",
"S_Q",
"Perform a quantity take off on selected objects based of a QTO rule configuration",
ui_context)
ui_context,
)
@classmethod
def draw_container(cls, context):
@@ -33,7 +33,7 @@ class AddOpening(bpy.types.Operator, tool.Ifc.Operator):
bl_label = "Apply Opening"
bl_options = {"REGISTER", "UNDO"}
bl_description = (
"Apply an Opening object on an Element. "
"Apply an Opening object on an Element. "
"The Element and the Opening to be applied should be selected. The order of selection is not important"
)