mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-13 01:37:51 -06:00
Remove use of deprecated extruders property
This commit is contained in:
parent
495ed17294
commit
0ff9d72c4c
15 changed files with 111 additions and 90 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue