Skip to content

Commit 08dfcea

Browse files
Moultclaude
andcommitted
Fix Python signatures in operator descriptions.
Closes #7797. Closes #7230. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent 9c8f257 commit 08dfcea

File tree

2 files changed

+20
-18
lines changed

2 files changed

+20
-18
lines changed

src/bonsai/bonsai/bim/module/cad/operator.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
class CadTrimExtend(bpy.types.Operator):
3838
bl_idname = "bim.cad_trim_extend"
3939
bl_label = "CAD Trim / Extend"
40+
bl_description = "Extends/reduces element to 3D cursor"
4041

4142
@classmethod
4243
def poll(cls, context):
@@ -82,6 +83,7 @@ def execute(self, context):
8283
class CadMitre(bpy.types.Operator):
8384
bl_idname = "bim.cad_mitre"
8485
bl_label = "CAD Mitre"
86+
bl_description = "Joins two non-parallel paths at their intersection"
8587

8688
@classmethod
8789
def poll(cls, context):

src/bonsai/bonsai/bim/module/cad/workspace.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -106,23 +106,23 @@ def draw_settings(
106106
)
107107

108108
row = layout.row(align=True)
109-
add_layout_hotkey_operator(row, "Extend", "S_E", "Extends/reduces element to 3D cursor", ui_context)
109+
add_layout_hotkey_operator(row, "Extend", "S_E", bpy.ops.bim.cad_trim_extend.__doc__.split("\n", 1)[1].strip(), ui_context)
110110
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
111111
add_layout_hotkey_operator(
112-
row, "Join", "S_T", "Joins two non-parallel paths at their intersection", ui_context
112+
row, "Join", "S_T", bpy.ops.bim.cad_mitre.__doc__.split("\n", 1)[1].strip(), ui_context
113113
)
114114
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
115-
add_layout_hotkey_operator(row, "Fillet", "S_F", bpy.ops.bim.add_ifcarcindex_fillet.__doc__, ui_context)
115+
add_layout_hotkey_operator(row, "Fillet", "S_F", bpy.ops.bim.add_ifcarcindex_fillet.__doc__.split("\n", 1)[1].strip(), ui_context)
116116
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
117-
add_layout_hotkey_operator(row, "Offset", "S_O", bpy.ops.bim.cad_offset.__doc__, ui_context)
117+
add_layout_hotkey_operator(row, "Offset", "S_O", bpy.ops.bim.cad_offset.__doc__.split("\n", 1)[1].strip(), ui_context)
118118
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
119-
add_layout_hotkey_operator(row, "Rectangle", "S_R", bpy.ops.bim.add_rectangle.__doc__, ui_context)
119+
add_layout_hotkey_operator(row, "Rectangle", "S_R", bpy.ops.bim.add_rectangle.__doc__.split("\n", 1)[1].strip(), ui_context)
120120
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
121-
add_layout_hotkey_operator(row, "Circle", "S_C", bpy.ops.bim.add_ifccircle.__doc__, ui_context)
121+
add_layout_hotkey_operator(row, "Circle", "S_C", bpy.ops.bim.add_ifccircle.__doc__.split("\n", 1)[1].strip(), ui_context)
122122
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
123-
add_layout_hotkey_operator(row, "3-Point Arc", "S_V", bpy.ops.bim.set_arc_index.__doc__, ui_context)
123+
add_layout_hotkey_operator(row, "3-Point Arc", "S_V", bpy.ops.bim.set_arc_index.__doc__.split("\n", 1)[1].strip(), ui_context)
124124
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
125-
add_layout_hotkey_operator(row, "Reset Vertex", "S_X", bpy.ops.bim.reset_vertex.__doc__, ui_context)
125+
add_layout_hotkey_operator(row, "Reset Vertex", "S_X", bpy.ops.bim.reset_vertex.__doc__.split("\n", 1)[1].strip(), ui_context)
126126

127127
elif (
128128
isinstance(data, tool.Geometry.TYPES_WITH_MESH_PROPERTIES)
@@ -132,15 +132,15 @@ def draw_settings(
132132
layout, "Edit Axis", "bim.edit_extrusion_axis", "bim.disable_editing_extrusion_axis", ui_context
133133
)
134134
row = layout.row(align=True)
135-
add_layout_hotkey_operator(row, "Extend", "S_E", "Extends/reduces element to 3D cursor", ui_context)
135+
add_layout_hotkey_operator(row, "Extend", "S_E", bpy.ops.bim.cad_trim_extend.__doc__.split("\n", 1)[1].strip(), ui_context)
136136
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
137137
add_layout_hotkey_operator(
138-
row, "Join", "S_T", "Joins two non-parallel paths at their intersection", ui_context
138+
row, "Join", "S_T", bpy.ops.bim.cad_mitre.__doc__.split("\n", 1)[1].strip(), ui_context
139139
)
140140
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
141-
add_layout_hotkey_operator(row, "Fillet", "S_F", bpy.ops.bim.cad_fillet.__doc__, ui_context)
141+
add_layout_hotkey_operator(row, "Fillet", "S_F", bpy.ops.bim.cad_fillet.__doc__.split("\n", 1)[1].strip(), ui_context)
142142
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
143-
add_layout_hotkey_operator(row, "Offset", "S_O", bpy.ops.bim.cad_offset.__doc__, ui_context)
143+
add_layout_hotkey_operator(row, "Offset", "S_O", bpy.ops.bim.cad_offset.__doc__.split("\n", 1)[1].strip(), ui_context)
144144

145145
else:
146146
if (
@@ -168,19 +168,19 @@ def draw_settings(
168168
add_layout_hotkey_operator(row, "Set Gable Roof Angle", "S_R", "Set Gable Roof Angle", ui_context)
169169

170170
row = layout.row(align=True)
171-
add_layout_hotkey_operator(row, "Extend", "S_E", "Extends/reduces element to 3D cursor", ui_context)
171+
add_layout_hotkey_operator(row, "Extend", "S_E", bpy.ops.bim.cad_trim_extend.__doc__.split("\n", 1)[1].strip(), ui_context)
172172
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
173173
add_layout_hotkey_operator(
174-
row, "Join", "S_T", "Joins two non-parallel paths at their intersection", ui_context
174+
row, "Join", "S_T", bpy.ops.bim.cad_mitre.__doc__.split("\n", 1)[1].strip(), ui_context
175175
)
176176
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
177-
add_layout_hotkey_operator(row, "Fillet", "S_F", bpy.ops.bim.add_ifcarcindex_fillet.__doc__, ui_context)
177+
add_layout_hotkey_operator(row, "Fillet", "S_F", bpy.ops.bim.add_ifcarcindex_fillet.__doc__.split("\n", 1)[1].strip(), ui_context)
178178
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
179-
add_layout_hotkey_operator(row, "Offset", "S_O", bpy.ops.bim.cad_offset.__doc__, ui_context)
179+
add_layout_hotkey_operator(row, "Offset", "S_O", bpy.ops.bim.cad_offset.__doc__.split("\n", 1)[1].strip(), ui_context)
180180
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
181-
add_layout_hotkey_operator(row, "2-Point Arc", "S_C", bpy.ops.bim.cad_arc_from_2_points.__doc__, ui_context)
181+
add_layout_hotkey_operator(row, "2-Point Arc", "S_C", bpy.ops.bim.cad_arc_from_2_points.__doc__.split("\n", 1)[1].strip(), ui_context)
182182
row = row if ui_context == "TOOL_HEADER" else layout.row(align=True)
183-
add_layout_hotkey_operator(row, "3-Point Arc", "S_V", bpy.ops.bim.cad_arc_from_3_points.__doc__, ui_context)
183+
add_layout_hotkey_operator(row, "3-Point Arc", "S_V", bpy.ops.bim.cad_arc_from_3_points.__doc__.split("\n", 1)[1].strip(), ui_context)
184184

185185

186186
class CadHotkey(bpy.types.Operator):

0 commit comments

Comments
 (0)