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:
authorJack Ha <jackha@gmail.com>2017-11-08 16:07:40 +0300
committerJack Ha <jackha@gmail.com>2017-11-08 16:07:40 +0300
commit41d5ec86a305d4fc0d5f85e159631d4936032b93 (patch)
tree406df4eecaf9ef4afcd5e4c7ada6048ab711f803 /cura/CuraActions.py
parent38670171f5063a0aa525117955da39135bca2a20 (diff)
CURA-4525 updated scene node menu and added multi buildplate arrange
Diffstat (limited to 'cura/CuraActions.py')
-rw-r--r--cura/CuraActions.py23
1 files changed, 7 insertions, 16 deletions
diff --git a/cura/CuraActions.py b/cura/CuraActions.py
index c313488cac..dbcd31f646 100644
--- a/cura/CuraActions.py
+++ b/cura/CuraActions.py
@@ -134,25 +134,16 @@ class CuraActions(QObject):
Logger.log("d", "Setting build plate number... %d" % build_plate_nr)
operation = GroupedOperation()
+ root = Application.getInstance().getController().getScene().getRoot()
+
nodes_to_change = []
for node in Selection.getAllSelectedObjects():
- # Do not change any nodes that already have the right extruder set.
- if node.callDecoration("getBuildPlateNumber") == build_plate_nr:
- continue
-
- # If the node is a group, apply the active extruder to all children of the group.
- if node.callDecoration("isGroup"):
- for grouped_node in BreadthFirstIterator(node):
- if grouped_node.callDecoration("getBuildPlateNumber") == build_plate_nr:
- continue
+ parent_node = node # Find the parent node to change instead
+ while parent_node.getParent() != root:
+ parent_node = parent_node.getParent()
- if grouped_node.callDecoration("isGroup"):
- continue
-
- nodes_to_change.append(grouped_node)
- continue
-
- nodes_to_change.append(node)
+ for single_node in BreadthFirstIterator(parent_node):
+ nodes_to_change.append(single_node)
if not nodes_to_change:
Logger.log("d", "Nothing to change.")