diff --git a/cura/Settings/ExtruderStack.py b/cura/Settings/ExtruderStack.py index 2995aae795..4400f621c6 100644 --- a/cura/Settings/ExtruderStack.py +++ b/cura/Settings/ExtruderStack.py @@ -10,10 +10,9 @@ from UM.MimeTypeDatabase import MimeType, MimeTypeDatabase from UM.Settings.ContainerStack import ContainerStack from UM.Settings.ContainerRegistry import ContainerRegistry from UM.Settings.Interfaces import ContainerInterface, PropertyEvaluationContext -from UM.Settings.SettingInstance import SettingInstance from . import Exceptions -from .CuraContainerStack import CuraContainerStack +from .CuraContainerStack import CuraContainerStack, _ContainerIndexes from .ExtruderManager import ExtruderManager if TYPE_CHECKING: @@ -57,14 +56,10 @@ class ExtruderStack(CuraContainerStack): # \return The filament diameter for the printer @property def materialDiameter(self) -> float: - containers_to_check = [self.variant, self.definitionChanges, self.definition] + context = PropertyEvaluationContext(self) + context.context["evaluate_from_container_index"] = _ContainerIndexes.Variant - for container in containers_to_check: - if container is not None: - material_diameter = container.getProperty("material_diameter", "value") - if material_diameter is not None: - return material_diameter - return -1 + return self.getProperty("material_diameter", "value", context = context) ## Return the approximate filament diameter that the machine requires. #