Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[CURA-12223] Force extruder position to stick during retrieval of property. #19899

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions cura/Settings/ExtruderStack.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Copyright (c) 2018 Ultimaker B.V.
# Copyright (c) 2024 UltiMaker
# Cura is released under the terms of the LGPLv3 or higher.

from typing import Any, Dict, TYPE_CHECKING, Optional
Expand All @@ -12,11 +12,8 @@
from UM.Settings.Interfaces import ContainerInterface, PropertyEvaluationContext
from UM.Util import parseBool

import cura.CuraApplication

from . import Exceptions
from .CuraContainerStack import CuraContainerStack, _ContainerIndexes
from .ExtruderManager import ExtruderManager

if TYPE_CHECKING:
from cura.Settings.GlobalStack import GlobalStack
Expand Down Expand Up @@ -141,7 +138,11 @@ def getProperty(self, key: str, property_name: str, context: Optional[PropertyEv
context.popContainer()
return result

limit_to_extruder = super().getProperty(key, "limit_to_extruder", context)
if not context:
context = PropertyEvaluationContext(self)
if "extruder_position" not in context.context:
context.context["extruder_position"] = super().getProperty(key, "limit_to_extruder", context)
limit_to_extruder = context.context["extruder_position"]
if limit_to_extruder is not None:
limit_to_extruder = str(limit_to_extruder)

Expand Down
Loading