mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-07 15:07:28 -06:00
Return the value for default extruder if the requested one could not be found
This fixes #5535
This commit is contained in:
parent
b415657492
commit
efe8f19109
1 changed files with 8 additions and 1 deletions
|
@ -42,7 +42,14 @@ class CuraFormulaFunctions:
|
||||||
try:
|
try:
|
||||||
extruder_stack = global_stack.extruders[str(extruder_position)]
|
extruder_stack = global_stack.extruders[str(extruder_position)]
|
||||||
except KeyError:
|
except KeyError:
|
||||||
Logger.log("w", "Value for %s of extruder %s was requested, but that extruder is not available" % (property_key, extruder_position))
|
if extruder_position != 0:
|
||||||
|
Logger.log("w", "Value for %s of extruder %s was requested, but that extruder is not available. Returning the result form extruder 0 instead" % (property_key, extruder_position))
|
||||||
|
# This fixes a very specific fringe case; If a profile was created for a custom printer and one of the
|
||||||
|
# extruder settings has been set to non zero and the profile is loaded for a machine that has only a single extruder
|
||||||
|
# it would cause all kinds of issues (and eventually a crash).
|
||||||
|
# See https://github.com/Ultimaker/Cura/issues/5535
|
||||||
|
return self.getValueInExtruder(0, property_key, context)
|
||||||
|
Logger.log("w", "Value for %s of extruder %s was requested, but that extruder is not available. " % (property_key, extruder_position))
|
||||||
return None
|
return None
|
||||||
|
|
||||||
value = extruder_stack.getRawProperty(property_key, "value", context = context)
|
value = extruder_stack.getRawProperty(property_key, "value", context = context)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue