CURA-4606 Ensure the correct material is highlighted in the material menu

This commit is contained in:
Jack Ha 2018-02-14 10:34:56 +01:00 committed by Lipu Fei
parent 54363bad02
commit 27169e883c
3 changed files with 20 additions and 60 deletions

View file

@ -4,7 +4,6 @@ from PyQt5.Qt import QTimer, QObject, pyqtSignal
from UM.Logger import Logger
from UM.Settings import ContainerRegistry
from UM.Settings import InstanceContainer
from cura.Machines.ContainerNode import ContainerNode
@ -227,7 +226,7 @@ class MaterialManager(QObject):
# 1. the given machine doesn't have materials;
# 2. cannot find any material InstanceContainers with the given settings.
#
def getMaterial(self, machine_definition_id: str, variant_name: Optional[str], diameter: float, root_material_id: str) -> Optional["InstanceContainer"]:
def getMaterialNode(self, machine_definition_id: str, variant_name: Optional[str], diameter: float, root_material_id: str) -> Optional["InstanceContainer"]:
# round the diameter to get the approximate diameter
rounded_diameter = str(round(diameter))
if rounded_diameter not in self._diameter_machine_variant_material_map: