Browse Source

Now the right extruder is actually used (instead of randomly mixing it up)

CURA-1758
Jaime van Kessel 8 years ago
parent
commit
87b9b17f98
2 changed files with 6 additions and 3 deletions
  1. 5 2
      cura/Settings/ExtruderManager.py
  2. 1 1
      resources/qml/Settings/SettingView.qml

+ 5 - 2
cura/Settings/ExtruderManager.py

@@ -47,9 +47,12 @@ class ExtruderManager(QObject):
             return 0 # No active machine, so no extruders.
         return len(self._extruder_trains[UM.Application.getInstance().getGlobalContainerStack().getId()])
 
-    @pyqtProperty("QVariantList", notify=extrudersChanged)
+    @pyqtProperty("QVariantMap", notify=extrudersChanged)
     def extruderIds(self):
-        return [self._extruder_trains[UM.Application.getInstance().getGlobalContainerStack().getId()][extruder].getId() for extruder in self._extruder_trains[UM.Application.getInstance().getGlobalContainerStack().getId()]]
+        map = {}
+        for position in self._extruder_trains[UM.Application.getInstance().getGlobalContainerStack().getId()]:
+            map[position] = self._extruder_trains[UM.Application.getInstance().getGlobalContainerStack().getId()][position].getId()
+        return map
 
     ##  The instance of the singleton pattern.
     #

+ 1 - 1
resources/qml/Settings/SettingView.qml

@@ -111,7 +111,7 @@ ScrollView
                             return Cura.MachineManager.activeMachineId
                         }
                     }
-                    return ExtruderManager.extruderIds[inheritStackProvider.properties.global_inherits_stack]
+                    return ExtruderManager.extruderIds[String(inheritStackProvider.properties.global_inherits_stack)]
                 }
             }