mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 18:39:07 +08:00
Don't crash if layer height is a formula
We obtain the layer height here but that might be a formula so we should evaluate that formula here. Fixes #4005.
This commit is contained in:
parent
1136033f97
commit
6df029971d
@ -6,10 +6,10 @@ from PyQt5.QtCore import Qt
|
||||
from UM.Application import Application
|
||||
from UM.Logger import Logger
|
||||
from UM.Qt.ListModel import ListModel
|
||||
from UM.Settings.SettingFunction import SettingFunction
|
||||
|
||||
from cura.Machines.QualityManager import QualityGroup
|
||||
|
||||
|
||||
#
|
||||
# QML Model for all built-in quality profiles. This model is used for the drop-down quality menu.
|
||||
#
|
||||
@ -106,4 +106,8 @@ class QualityProfilesDropDownMenuModel(ListModel):
|
||||
container = global_stack.definition
|
||||
if container and container.hasProperty("layer_height", "value"):
|
||||
layer_height = container.getProperty("layer_height", "value")
|
||||
|
||||
if isinstance(layer_height, SettingFunction):
|
||||
layer_height = layer_height()
|
||||
|
||||
return float(layer_height)
|
||||
|
Loading…
x
Reference in New Issue
Block a user