mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-26 20:31:35 -07:00
Add a multiplySelection method to CuraActions
Contributes to CURA-3609
This commit is contained in:
parent
905e59354b
commit
c21895de97
2 changed files with 11 additions and 0 deletions
|
|
@ -12,6 +12,7 @@ from UM.Scene.Selection import Selection
|
||||||
from UM.Operations.GroupedOperation import GroupedOperation
|
from UM.Operations.GroupedOperation import GroupedOperation
|
||||||
from UM.Operations.SetTransformOperation import SetTransformOperation
|
from UM.Operations.SetTransformOperation import SetTransformOperation
|
||||||
|
|
||||||
|
from .MultiplyObjectsJob import MultiplyObjectsJob
|
||||||
|
|
||||||
class CuraActions(QObject):
|
class CuraActions(QObject):
|
||||||
def __init__(self, parent = None):
|
def __init__(self, parent = None):
|
||||||
|
|
@ -43,5 +44,13 @@ class CuraActions(QObject):
|
||||||
operation.addOperation(center_operation)
|
operation.addOperation(center_operation)
|
||||||
operation.push()
|
operation.push()
|
||||||
|
|
||||||
|
## Multiply all objects in the selection
|
||||||
|
#
|
||||||
|
# \param count The number of times to multiply the selection.
|
||||||
|
@pyqtSlot(int)
|
||||||
|
def multiplySelection(self, count: int) -> None:
|
||||||
|
job = MultiplyObjectsJob(Selection.getAllSelectedObjects(), count, 8)
|
||||||
|
job.start()
|
||||||
|
return
|
||||||
def _openUrl(self, url):
|
def _openUrl(self, url):
|
||||||
QDesktopServices.openUrl(url)
|
QDesktopServices.openUrl(url)
|
||||||
|
|
|
||||||
|
|
@ -54,6 +54,8 @@ Menu
|
||||||
width: 400 * Screen.devicePixelRatio
|
width: 400 * Screen.devicePixelRatio
|
||||||
height: 80 * Screen.devicePixelRatio
|
height: 80 * Screen.devicePixelRatio
|
||||||
|
|
||||||
|
onAccepted: CuraActions.multiplySelection(copiesField.value)
|
||||||
|
|
||||||
signal reset()
|
signal reset()
|
||||||
onReset:
|
onReset:
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue