mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 22:54:01 -06:00
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.
This commit is contained in:
parent
0db99e8f21
commit
01796b99cd
1 changed files with 5 additions and 12 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue