From 01796b99cd3ab7485df25f104cd7fedbe67f88bb Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Tue, 27 Aug 2019 11:06:35 +0200 Subject: [PATCH] Simplify getting layer height The stack already makes it fall through properly, so there's no need to implement the fallback again here. The only change is that it now displays 0.1mm as default layer height if there is no quality profile active. I don't think this makes a difference since we don't show the layer height then anyway. And technically it would be more correct too. Contributes to issue CURA-6600. --- cura/Settings/MachineManager.py | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/cura/Settings/MachineManager.py b/cura/Settings/MachineManager.py index f5daeddf56..75bb87c8cf 100755 --- a/cura/Settings/MachineManager.py +++ b/cura/Settings/MachineManager.py @@ -570,22 +570,15 @@ class MachineManager(QObject): # This is indicated together with the name of the active quality profile. # # \return The layer height of the currently active quality profile. If - # there is no quality profile, this returns 0. + # there is no quality profile, this returns the default layer height. @pyqtProperty(float, notify = activeQualityGroupChanged) def activeQualityLayerHeight(self) -> float: if not self._global_container_stack: return 0 - if self._current_quality_changes_group: - value = self._global_container_stack.getRawProperty("layer_height", "value", skip_until_container = self._global_container_stack.qualityChanges.getId()) - if isinstance(value, SettingFunction): - value = value(self._global_container_stack) - return value - elif self._current_quality_group: - value = self._global_container_stack.getRawProperty("layer_height", "value", skip_until_container = self._global_container_stack.quality.getId()) - if isinstance(value, SettingFunction): - value = value(self._global_container_stack) - return value - return 0 + value = self._global_container_stack.getRawProperty("layer_height", "value", skip_until_container = self._global_container_stack.qualityChanges.getId()) + if isinstance(value, SettingFunction): + value = value(self._global_container_stack) + return value @pyqtProperty(str, notify = activeVariantChanged) def globalVariantName(self) -> str: