From b9a99d46922ff52214b7012ed8dea50a89d8524b Mon Sep 17 00:00:00 2001 From: Jack Ha Date: Thu, 11 Jan 2018 09:33:07 +0100 Subject: [PATCH] CURA-4525 fix placement on load to only avoid objects on current build plate --- cura/CuraActions.py | 2 +- cura/CuraApplication.py | 12 ++++++++---- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/cura/CuraActions.py b/cura/CuraActions.py index 2474e218e8..f5aace805b 100644 --- a/cura/CuraActions.py +++ b/cura/CuraActions.py @@ -73,7 +73,7 @@ class CuraActions(QObject): # \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 = MultiplyObjectsJob(Selection.getAllSelectedObjects(), count, min_offset = 8) job.start() ## Delete all selected objects. diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index dfb78cd3b2..a2ce5c322c 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -1421,16 +1421,20 @@ class CuraApplication(QtApplication): filename = job.getFileName() self._currently_loading_files.remove(filename) - root = self.getController().getScene().getRoot() - arranger = Arrange.create(scene_root = root) - min_offset = 8 - self.fileLoaded.emit(filename) arrange_objects_on_load = ( not Preferences.getInstance().getValue("cura/use_multi_build_plate") or not Preferences.getInstance().getValue("cura/not_arrange_objects_on_load")) target_build_plate = self.getBuildPlateModel().activeBuildPlate if arrange_objects_on_load else -1 + root = self.getController().getScene().getRoot() + fixed_nodes = [] + for node_ in DepthFirstIterator(root): + if node_.callDecoration("isSliceable") and node_.callDecoration("getBuildPlateNumber") == target_build_plate: + fixed_nodes.append(node_) + arranger = Arrange.create(fixed_nodes = fixed_nodes) + min_offset = 8 + for original_node in nodes: # Create a CuraSceneNode just if the original node is not that type