diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index a9cafd4fc6..45221738be 100644 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -585,16 +585,10 @@ class CuraApplication(QtApplication): def updatePlatformActivity(self, node = None): count = 0 scene_bounding_box = None - should_pause = False for node in DepthFirstIterator(self.getController().getScene().getRoot()): if type(node) is not SceneNode or (not node.getMeshData() and not node.callDecoration("isBlockSlicing")): continue - if node.callDecoration("isBlockSlicing"): - should_pause = True - gcode_list = node.callDecoration("getGCodeList") - if gcode_list is not None: - self.getController().getScene().gcode_list = gcode_list - + count += 1 if not scene_bounding_box: scene_bounding_box = node.getBoundingBox() @@ -603,16 +597,6 @@ class CuraApplication(QtApplication): if other_bb is not None: scene_bounding_box = scene_bounding_box + node.getBoundingBox() - print_information = self.getPrintInformation() - if should_pause: - self.getBackend().pauseSlicing() - if print_information: - print_information.setPreSliced(True) - else: - self.getBackend().continueSlicing() - if print_information: - print_information.setPreSliced(False) - if not scene_bounding_box: scene_bounding_box = AxisAlignedBox.Null diff --git a/plugins/CuraEngineBackend/CuraEngineBackend.py b/plugins/CuraEngineBackend/CuraEngineBackend.py index 44009ae1de..93e2bd7c68 100644 --- a/plugins/CuraEngineBackend/CuraEngineBackend.py +++ b/plugins/CuraEngineBackend/CuraEngineBackend.py @@ -12,6 +12,8 @@ from UM.PluginRegistry import PluginRegistry from UM.Resources import Resources from UM.Settings.Validator import ValidatorState #To find if a setting is in an error state. We can't slice then. from UM.Platform import Platform +from UM.Scene.Iterator.DepthFirstIterator import DepthFirstIterator + import cura.Settings @@ -313,6 +315,26 @@ class CuraEngineBackend(Backend): if source is self._scene.getRoot(): return + application = Application.getInstance() + + should_pause = False + for node in DepthFirstIterator(self._scene.getRoot()): + if node.callDecoration("isBlockSlicing"): + should_pause = True + gcode_list = node.callDecoration("getGCodeList") + if gcode_list is not None: + self._scene.gcode_list = gcode_list + + print_information = application.getPrintInformation() + if should_pause: + self.pauseSlicing() + if print_information: + print_information.setPreSliced(True) + else: + self.continueSlicing() + if print_information: + print_information.setPreSliced(False) + if source.getMeshData() is None: return