diff options
author | Jaime van Kessel <nallath@gmail.com> | 2019-09-13 15:11:55 +0300 |
---|---|---|
committer | Jaime van Kessel <nallath@gmail.com> | 2019-09-13 18:27:16 +0300 |
commit | 0ff9d72c4c3bba930dc7f6eac243a981cbc3e641 (patch) | |
tree | 28b1b714084d2226a135b04f6b79a1618d60e4fe /plugins/ModelChecker | |
parent | 495ed17294d96579ab6ff145a58e040963b2821c (diff) |
Remove use of deprecated extruders property
Diffstat (limited to 'plugins/ModelChecker')
-rw-r--r-- | plugins/ModelChecker/ModelChecker.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/ModelChecker/ModelChecker.py b/plugins/ModelChecker/ModelChecker.py index 0619c95d67..0afed28f19 100644 --- a/plugins/ModelChecker/ModelChecker.py +++ b/plugins/ModelChecker/ModelChecker.py @@ -76,7 +76,9 @@ class ModelChecker(QObject, Extension): # This function can be triggered in the middle of a machine change, so do not proceed if the machine change # has not done yet. - if str(node_extruder_position) not in global_container_stack.extruders: + try: + extruder = global_container_stack.extruderList[int(node_extruder_position)] + except IndexError: Application.getInstance().callLater(lambda: self.onChanged.emit()) return False @@ -131,9 +133,9 @@ class ModelChecker(QObject, Extension): material_shrinkage = {} # Get all shrinkage values of materials used - for extruder_position, extruder in global_container_stack.extruders.items(): + for extruder_position, extruder in enumerate(global_container_stack.extruderList): shrinkage = extruder.material.getProperty("material_shrinkage_percentage", "value") if shrinkage is None: shrinkage = 0 - material_shrinkage[extruder_position] = shrinkage + material_shrinkage[str(extruder_position)] = shrinkage return material_shrinkage |