Remove use of deprecated extruders property

This commit is contained in:
Jaime van Kessel 2019-09-13 14:11:55 +02:00
parent 495ed17294
commit 0ff9d72c4c
No known key found for this signature in database
GPG key ID: 3710727397403C91
15 changed files with 111 additions and 90 deletions

View file

@ -40,8 +40,8 @@ class CuraFormulaFunctions:
global_stack = machine_manager.activeMachine
try:
extruder_stack = global_stack.extruders[str(extruder_position)]
except KeyError:
extruder_stack = global_stack.extruderList[int(extruder_position)]
except IndexError:
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
@ -104,11 +104,14 @@ class CuraFormulaFunctions:
machine_manager = self._application.getMachineManager()
global_stack = machine_manager.activeMachine
extruder_stack = global_stack.extruders[str(extruder_position)]
try:
extruder_stack = global_stack.extruderList[extruder_position]
except IndexError:
Logger.log("w", "Unable to find extruder on in index %s", extruder_position)
else:
context = self.createContextForDefaultValueEvaluation(extruder_stack)
context = self.createContextForDefaultValueEvaluation(extruder_stack)
return self.getValueInExtruder(extruder_position, property_key, context = context)
return self.getValueInExtruder(extruder_position, property_key, context = context)
# Gets all default setting values as a list from all extruders of the currently active machine.
# The default values are those excluding the values in the user_changes container.