No longer use deprecated MaterialManager when asking for available materials

Use the ContainerTree structure instead. That's what it's for.

Contributes to issue CURA-6600.
This commit is contained in:
Ghostkeeper 2019-08-13 16:51:33 +02:00
parent 7f84145c9a
commit 5738af4bb8
No known key found for this signature in database
GPG key ID: 86BEF881AE2CF276
2 changed files with 5 additions and 11 deletions

View file

@ -168,7 +168,7 @@ class MaterialManager(QObject):
# MaterialNodes from the ContainerTree that are available for the given
# printer and variant.
def getAvailableMaterials(self, definition_id: str, nozzle_name: Optional[str]) -> Dict[str, MaterialNode]:
return ContainerTree.getInstance().machines[definition_id].variants.get(nozzle_name, "empty_variant").materials
return ContainerTree.getInstance().machines[definition_id].variants[nozzle_name].materials
#
# A convenience function to get available materials for the given machine with the extruder position.