diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index 77bda87825..61802167a7 100644 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -37,6 +37,7 @@ class BuildVolume(SceneNode): self.setCalculateBoundingBox(False) + self._active_container_stack = None Application.getInstance().globalContainerStackChanged.connect(self._onGlobalContainerStackChanged) self._onGlobalContainerStackChanged() @@ -158,9 +159,14 @@ class BuildVolume(SceneNode): Application.getInstance().getController().getScene()._maximum_bounds = scale_to_max_bounds def _onGlobalContainerStackChanged(self): + if self._active_container_stack: + self._active_container_stack.propertyChanged.disconnect(self._onSettingPropertyChanged) + self._active_container_stack = Application.getInstance().getGlobalContainerStack() if self._active_container_stack: + self._active_container_stack.propertyChanged.connect(self._onSettingPropertyChanged) + self._width = self._active_container_stack.getProperty("machine_width", "value") if self._active_container_stack.getProperty("print_sequence", "value") == "one_at_a_time": self._height = self._active_container_stack.getProperty("gantry_height", "value") @@ -172,12 +178,15 @@ class BuildVolume(SceneNode): self.rebuild() - def _onSettingValueChanged(self, setting_key): + def _onSettingPropertyChanged(self, setting_key, property_name): + if property_name != "value": + return + if setting_key == "print_sequence": if Application.getInstance().getGlobalContainerStack().getProperty("print_sequence", "value") == "one_at_a_time": self._height = self._active_container_stack.getProperty("gantry_height", "value") else: - self._height = self._active_container_stack.getProperty("machine_depth", "value") + self._height = self._active_container_stack.getProperty("machine_height", "value") self.rebuild() if setting_key in self._skirt_settings: self._updateDisallowedAreas() diff --git a/plugins/SolidView/SolidView.py b/plugins/SolidView/SolidView.py index 9aec1a7290..71b29c8186 100644 --- a/plugins/SolidView/SolidView.py +++ b/plugins/SolidView/SolidView.py @@ -35,7 +35,6 @@ class SolidView(View): self._disabled_shader.setUniformValue("u_overhangAngle", math.cos(math.radians(0))) if Application.getInstance().getGlobalContainerStack(): - if Preferences.getInstance().getValue("view/show_overhang"): angle = Application.getInstance().getGlobalContainerStack().getProperty("support_angle", "value") if angle is not None: