Assembly: Enable part manipulation in active App::Part with the fixed joint.

This commit is contained in:
Paddle
2024-01-11 11:17:55 +01:00
committed by PaddleStroke
parent d13df26333
commit a0749888c4
3 changed files with 107 additions and 41 deletions

View File

@@ -62,7 +62,10 @@ class CommandCreateJointFixed:
return {
"Pixmap": "Assembly_CreateJointFixed",
"MenuText": QT_TRANSLATE_NOOP("Assembly_CreateJointFixed", "Create Fixed Joint"),
"MenuText": QT_TRANSLATE_NOOP(
"Assembly_CreateJointFixed",
"If an assembly is active : Create a Fixed Joint.\n If a part is active : Position sub parts by matching.",
),
"Accel": "J",
"ToolTip": "<p>"
+ QT_TRANSLATE_NOOP(
@@ -74,7 +77,10 @@ class CommandCreateJointFixed:
}
def IsActive(self):
return isCreateJointActive()
if UtilsAssembly.activePart:
return UtilsAssembly.assembly_has_at_least_n_parts(2)
return UtilsAssembly.isAssemblyGrounded() and UtilsAssembly.assembly_has_at_least_n_parts(2)
def Activated(self):
activateJoint(0)