Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/Ultimaker/Cura.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJaime van Kessel <nallath@gmail.com>2021-10-06 16:57:18 +0300
committerJaime van Kessel <nallath@gmail.com>2021-10-06 16:57:18 +0300
commit4aae3d7e2e782fbf53ec8e1e04a7774145e1a77d (patch)
treef00212ba59ce24d3a4ccb512c7224c5caf8fe682 /cura/MultiplyObjectsJob.py
parent4ce69a9eb5727f828f5d35ee5f98dd3da031769a (diff)
Move duplicated modifier meshes a bit after duplication
This makes sure that they are visible / selectable after multiplication CURA-7851
Diffstat (limited to 'cura/MultiplyObjectsJob.py')
-rw-r--r--cura/MultiplyObjectsJob.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/cura/MultiplyObjectsJob.py b/cura/MultiplyObjectsJob.py
index 5df02df288..2bbafc2015 100644
--- a/cura/MultiplyObjectsJob.py
+++ b/cura/MultiplyObjectsJob.py
@@ -6,9 +6,11 @@ from typing import List
from UM.Application import Application
from UM.Job import Job
+from UM.Math.Vector import Vector
from UM.Message import Message
from UM.Operations.AddSceneNodeOperation import AddSceneNodeOperation
from UM.Operations.GroupedOperation import GroupedOperation
+from UM.Operations.TranslateOperation import TranslateOperation
from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator
from UM.Scene.SceneNode import SceneNode
from UM.i18n import i18nCatalog
@@ -84,6 +86,10 @@ class MultiplyObjectsJob(Job):
if nodes_to_add_without_arrange:
for nested_node in nodes_to_add_without_arrange:
group_operation.addOperation(AddSceneNodeOperation(nested_node, nested_node.getParent()))
+ # Move the node a tiny bit so it doesn't overlap with the existing one.
+ # This doesn't fix it if someone creates more than one duplicate, but it at least shows that something
+ # happened (and after moving it, it's clear that there are more underneath)
+ group_operation.addOperation(TranslateOperation(nested_node, Vector(2.5, 2.5, 2.5)))
group_operation.redo()
status_message.hide()