CURA-4400 add checking for enabled extruder in setting _outside_buildarea, cleaned up a bit and factored some functions out BuildVolume

This commit is contained in:
Jack Ha 2018-03-01 11:54:31 +01:00
parent 11bad271d3
commit 657a52a5e7
5 changed files with 58 additions and 42 deletions

View file

@ -61,7 +61,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 = any(bool(self._stack.getProperty(setting, "value")) for setting in self._non_printing_mesh_settings)
deep_copy._is_non_printing_mesh = self.evaluateIsNonPrintingMesh()
return deep_copy
@ -89,10 +89,13 @@ class SettingOverrideDecorator(SceneNodeDecorator):
def isNonPrintingMesh(self):
return self._is_non_printing_mesh
def evaluateIsNonPrintingMesh(self):
return any(bool(self._stack.getProperty(setting, "value")) for setting in self._non_printing_mesh_settings)
def _onSettingChanged(self, instance, property_name): # Reminder: 'property' is a built-in function
# Trigger slice/need slicing if the value has changed.
if property_name == "value":
self._is_non_printing_mesh = any(bool(self._stack.getProperty(setting, "value")) for setting in self._non_printing_mesh_settings)
self._is_non_printing_mesh = self.evaluateIsNonPrintingMesh()
Application.getInstance().getBackend().needsSlicing()
Application.getInstance().getBackend().tickle()