diff --git a/cura/PreviewPass.py b/cura/PreviewPass.py index 4241a2f243..436e2719b7 100644 --- a/cura/PreviewPass.py +++ b/cura/PreviewPass.py @@ -79,10 +79,10 @@ class PreviewPass(RenderPass): for node in DepthFirstIterator(self._scene.getRoot()): if node.callDecoration("isSliceable") and node.getMeshData() and node.isVisible(): per_mesh_stack = node.callDecoration("getStack") - if node.callDecoration("isNonPrintingMesh"): + if node.callDecoration("isNonThumbnailVisibleMesh"): # Non printing mesh continue - elif per_mesh_stack is not None and per_mesh_stack.getProperty("support_mesh", "value") == True: + elif per_mesh_stack is not None and per_mesh_stack.getProperty("support_mesh", "value"): # Support mesh uniforms = {} shade_factor = 0.6 @@ -112,4 +112,3 @@ class PreviewPass(RenderPass): batch_support_mesh.render(render_camera) self.release() - diff --git a/cura/Settings/SettingOverrideDecorator.py b/cura/Settings/SettingOverrideDecorator.py index 69d98314b6..a662027d8f 100644 --- a/cura/Settings/SettingOverrideDecorator.py +++ b/cura/Settings/SettingOverrideDecorator.py @@ -30,6 +30,7 @@ class SettingOverrideDecorator(SceneNodeDecorator): # Note that Support Mesh is not in here because it actually generates # g-code in the volume of the mesh. _non_printing_mesh_settings = {"anti_overhang_mesh", "infill_mesh", "cutting_mesh"} + _non_thumbnail_visible_settings = {"anti_overhang_mesh", "infill_mesh", "cutting_mesh", "support_mesh"} def __init__(self): super().__init__() @@ -41,6 +42,7 @@ class SettingOverrideDecorator(SceneNodeDecorator): self._extruder_stack = ExtruderManager.getInstance().getExtruderStack(0).getId() self._is_non_printing_mesh = False + self._is_non_thumbnail_visible_mesh = False self._stack.propertyChanged.connect(self._onSettingChanged) @@ -72,6 +74,7 @@ class SettingOverrideDecorator(SceneNodeDecorator): # use value from the stack because there can be a delay in signal triggering and "_is_non_printing_mesh" # has not been updated yet. deep_copy._is_non_printing_mesh = self.evaluateIsNonPrintingMesh() + deep_copy._is_non_thumbnail_visible_mesh = self.evaluateIsNonThumbnailVisibleMesh() return deep_copy @@ -102,10 +105,17 @@ class SettingOverrideDecorator(SceneNodeDecorator): def evaluateIsNonPrintingMesh(self): return any(bool(self._stack.getProperty(setting, "value")) for setting in self._non_printing_mesh_settings) + def isNonThumbnailVisibleMesh(self): + return self._is_non_thumbnail_visible_mesh + + def evaluateIsNonThumbnailVisibleMesh(self): + return any(bool(self._stack.getProperty(setting, "value")) for setting in self._non_thumbnail_visible_settings) + def _onSettingChanged(self, instance, property_name): # Reminder: 'property' is a built-in function if property_name == "value": # Trigger slice/need slicing if the value has changed. self._is_non_printing_mesh = self.evaluateIsNonPrintingMesh() + self._is_non_thumbnail_visible_mesh = self.evaluateIsNonThumbnailVisibleMesh() Application.getInstance().getBackend().needsSlicing() Application.getInstance().getBackend().tickle() diff --git a/cura/Snapshot.py b/cura/Snapshot.py index d1bfeea40f..b730c1fdcf 100644 --- a/cura/Snapshot.py +++ b/cura/Snapshot.py @@ -48,7 +48,7 @@ class Snapshot: # determine zoom and look at bbox = None for node in DepthFirstIterator(root): - if node.callDecoration("isSliceable") and node.getMeshData() and node.isVisible() and not node.callDecoration("isNonPrintingMesh"): + if node.callDecoration("isSliceable") and node.getMeshData() and node.isVisible() and not node.callDecoration("isNonThumbnailVisibleMesh"): if bbox is None: bbox = node.getBoundingBox() else: