mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-18 05:56:00 +08:00
Add a setSelectionExtruder method to CuraActions
Can be used to set the extruder used for the selection Contributes to CURA-3609
This commit is contained in:
parent
61f542c215
commit
5f65cb25c6
@ -16,6 +16,8 @@ from UM.Operations.SetTransformOperation import SetTransformOperation
|
||||
from .SetParentOperation import SetParentOperation
|
||||
from .MultiplyObjectsJob import MultiplyObjectsJob
|
||||
|
||||
from cura.Settings.SetObjectExtruderOperation import SetObjectExtruderOperation
|
||||
|
||||
class CuraActions(QObject):
|
||||
def __init__(self, parent = None):
|
||||
super().__init__(parent)
|
||||
@ -74,5 +76,15 @@ class CuraActions(QObject):
|
||||
op.addOperation(SetParentOperation(remaining_nodes_in_group[0], group_node.getParent()))
|
||||
op.addOperation(RemoveSceneNodeOperation(group_node))
|
||||
op.push()
|
||||
|
||||
@pyqtSlot(str)
|
||||
def setSelectionExtruder(self, extruder_id: str) -> None:
|
||||
operation = GroupedOperation()
|
||||
for node in Selection.getAllSelectedObjects():
|
||||
if node.callDecoration("getActiveExtruder") == extruder_id:
|
||||
continue
|
||||
operation.addOperation(SetObjectExtruderOperation(node, extruder_id))
|
||||
operation.push()
|
||||
|
||||
def _openUrl(self, url):
|
||||
QDesktopServices.openUrl(url)
|
||||
|
Loading…
x
Reference in New Issue
Block a user