mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-05-19 09:10:47 +08:00
Merge pull request #4794 from fieldOfView/fix_adhesion_type_error
Fix adhesion type error during startup
This commit is contained in:
commit
401a6b5f8b
@ -489,6 +489,8 @@ class BuildVolume(SceneNode):
|
|||||||
|
|
||||||
def _updateRaftThickness(self):
|
def _updateRaftThickness(self):
|
||||||
old_raft_thickness = self._raft_thickness
|
old_raft_thickness = self._raft_thickness
|
||||||
|
if self._global_container_stack.extruders:
|
||||||
|
# This might be called before the extruder stacks have initialised, in which case getting the adhesion_type fails
|
||||||
self._adhesion_type = self._global_container_stack.getProperty("adhesion_type", "value")
|
self._adhesion_type = self._global_container_stack.getProperty("adhesion_type", "value")
|
||||||
self._raft_thickness = 0.0
|
self._raft_thickness = 0.0
|
||||||
if self._adhesion_type == "raft":
|
if self._adhesion_type == "raft":
|
||||||
|
@ -5,6 +5,7 @@ from typing import Any, List, Optional, TYPE_CHECKING
|
|||||||
|
|
||||||
from UM.Settings.PropertyEvaluationContext import PropertyEvaluationContext
|
from UM.Settings.PropertyEvaluationContext import PropertyEvaluationContext
|
||||||
from UM.Settings.SettingFunction import SettingFunction
|
from UM.Settings.SettingFunction import SettingFunction
|
||||||
|
from UM.Logger import Logger
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from cura.CuraApplication import CuraApplication
|
from cura.CuraApplication import CuraApplication
|
||||||
@ -38,7 +39,11 @@ class CuraFormulaFunctions:
|
|||||||
extruder_position = int(machine_manager.defaultExtruderPosition)
|
extruder_position = int(machine_manager.defaultExtruderPosition)
|
||||||
|
|
||||||
global_stack = machine_manager.activeMachine
|
global_stack = machine_manager.activeMachine
|
||||||
|
try:
|
||||||
extruder_stack = global_stack.extruders[str(extruder_position)]
|
extruder_stack = global_stack.extruders[str(extruder_position)]
|
||||||
|
except KeyError:
|
||||||
|
Logger.log("w", "Value for %s of extruder %s was requested, but that extruder is not available" % (property_key, extruder_position))
|
||||||
|
return None
|
||||||
|
|
||||||
value = extruder_stack.getRawProperty(property_key, "value", context = context)
|
value = extruder_stack.getRawProperty(property_key, "value", context = context)
|
||||||
if isinstance(value, SettingFunction):
|
if isinstance(value, SettingFunction):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user