mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-03 01:04:35 +08:00
Duplication now works regardles how deeply group nested a node is
CURA-1578
This commit is contained in:
parent
e291a4360f
commit
a7e22e82b6
@ -585,18 +585,16 @@ class CuraApplication(QtApplication):
|
|||||||
node = Selection.getSelectedObject(0)
|
node = Selection.getSelectedObject(0)
|
||||||
|
|
||||||
if node:
|
if node:
|
||||||
|
current_node = node
|
||||||
|
# Find the topmost group
|
||||||
|
while current_node.getParent() and current_node.getParent().callDecoration("isGroup"):
|
||||||
|
current_node = current_node.getParent()
|
||||||
|
|
||||||
|
new_node = copy.deepcopy(current_node)
|
||||||
|
|
||||||
op = GroupedOperation()
|
op = GroupedOperation()
|
||||||
for _ in range(count):
|
for _ in range(count):
|
||||||
if node.getParent() and node.getParent().callDecoration("isGroup"):
|
op.addOperation(AddSceneNodeOperation(new_node, current_node.getParent()))
|
||||||
new_node = copy.deepcopy(node.getParent()) #Copy the group node.
|
|
||||||
new_node.callDecoration("recomputeConvexHull")
|
|
||||||
|
|
||||||
op.addOperation(AddSceneNodeOperation(new_node,node.getParent().getParent()))
|
|
||||||
else:
|
|
||||||
new_node = copy.deepcopy(node)
|
|
||||||
new_node.callDecoration("recomputeConvexHull")
|
|
||||||
op.addOperation(AddSceneNodeOperation(new_node, node.getParent()))
|
|
||||||
|
|
||||||
op.push()
|
op.push()
|
||||||
|
|
||||||
## Center object on platform.
|
## Center object on platform.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user