diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index cf6284bf86..f25fbe19bc 100644 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -594,9 +594,9 @@ class CuraApplication(QtApplication): 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("shouldBlockSlicing")): + if type(node) is not SceneNode or (not node.getMeshData() and node.callDecoration("isSliceable") is None): continue - if node.callDecoration("shouldBlockSlicing"): + if node.callDecoration("isSliceable") is False: should_pause = True gcode_list = node.callDecoration("gCodeList") if gcode_list is not None: @@ -613,7 +613,8 @@ class CuraApplication(QtApplication): print_information = self.getPrintInformation() if should_pause: self.getBackend().pauseSlicing() - print_information.setPreSliced(True) + if print_information: + print_information.setPreSliced(True) else: self.getBackend().continueSlicing() if print_information: @@ -739,7 +740,7 @@ class CuraApplication(QtApplication): for node in DepthFirstIterator(self.getController().getScene().getRoot()): if type(node) is not SceneNode: continue - if (not node.getMeshData() and node.callDecoration("isSliceable")) and not node.callDecoration("isGroup"): + if (not node.getMeshData() and node.callDecoration("isSliceable") is None) and not node.callDecoration("isGroup"): continue # Node that doesnt have a mesh and is not a group. if node.getParent() and node.getParent().callDecoration("isGroup"): continue # Grouped nodes don't need resetting as their parent (the group) is resetted) @@ -1046,7 +1047,7 @@ class CuraApplication(QtApplication): scene = self.getController().getScene() for node in DepthFirstIterator(scene.getRoot()): - if node.callDecoration("shouldBlockSlicing"): + if node.callDecoration("isSliceable") is False: self.deleteAll() break @@ -1093,13 +1094,10 @@ class CuraApplication(QtApplication): if extension.lower() in self.non_sliceable_extensions: self.changeLayerViewSignal.emit() sliceable_decorator = SliceableObjectDecorator() - sliceable_decorator.setBlockSlicing(True) sliceable_decorator.setSliceable(False) node.addDecorator(sliceable_decorator) else: sliceable_decorator = SliceableObjectDecorator() - sliceable_decorator.setBlockSlicing(False) - sliceable_decorator.setSliceable(True) node.addDecorator(sliceable_decorator) scene = self.getController().getScene() diff --git a/cura/SliceableObjectDecorator.py b/cura/SliceableObjectDecorator.py index 12dbbcb751..7fa3ca37f2 100644 --- a/cura/SliceableObjectDecorator.py +++ b/cura/SliceableObjectDecorator.py @@ -6,16 +6,9 @@ class SliceableObjectDecorator(SceneNodeDecorator): def __init__(self): super().__init__() self._sliceable = True - self._block_slicing = False def isSliceable(self): return self._sliceable def setSliceable(self, sliceable): self._sliceable = sliceable - - def shouldBlockSlicing(self): - return self._block_slicing - - def setBlockSlicing(self, block_slicing): - self._block_slicing = block_slicing diff --git a/plugins/LayerView/LayerPass.py b/plugins/LayerView/LayerPass.py index ca895619a3..4a494a3436 100644 --- a/plugins/LayerView/LayerPass.py +++ b/plugins/LayerView/LayerPass.py @@ -49,7 +49,7 @@ class LayerPass(RenderPass): if isinstance(node, ToolHandle): tool_handle_batch.addItem(node.getWorldTransformation(), mesh = node.getSolidMesh()) - elif isinstance(node, SceneNode) and (node.getMeshData() or not node.callDecoration("isSliceable")) and node.isVisible(): + elif isinstance(node, SceneNode) and (node.getMeshData() or node.callDecoration("isSliceable") is False) and node.isVisible(): layer_data = node.callDecoration("getLayerData") if not layer_data: continue