mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Fix lookup for upgraded intents
CURA-10406
This commit is contained in:
parent
884ec911e7
commit
14ec6560e4
2 changed files with 16 additions and 1 deletions
|
@ -464,9 +464,15 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
|||
# If the global stack is found, we check if there are conflicts in the extruder stacks
|
||||
for extruder_stack_file in extruder_stack_files:
|
||||
serialized = archive.open(extruder_stack_file).read().decode("utf-8")
|
||||
not_upgraded_serialize = serialized
|
||||
|
||||
serialized = ExtruderStack._updateSerialized(serialized, extruder_stack_file)
|
||||
parser = ConfigParser(interpolation = None)
|
||||
parser.read_string(serialized)
|
||||
|
||||
not_upgraded_parser = ConfigParser(interpolation = None)
|
||||
not_upgraded_parser.read_string(not_upgraded_serialize)
|
||||
|
||||
# The check should be done for the extruder stack that's associated with the existing global stack,
|
||||
# and those extruder stacks may have different IDs.
|
||||
# So we check according to the positions
|
||||
|
@ -496,9 +502,16 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
|||
extruder_info.user_changes_info = instance_container_info_dict[user_changes_id]
|
||||
self._machine_info.extruder_info_dict[position] = extruder_info
|
||||
|
||||
intent_container_id = parser["containers"][str(_ContainerIndexes.Intent)]
|
||||
|
||||
intent_id = parser["containers"][str(_ContainerIndexes.Intent)]
|
||||
if intent_id not in ("empty", "empty_intent"):
|
||||
if intent_container_id in instance_container_info_dict:
|
||||
extruder_info.intent_info = instance_container_info_dict[intent_id]
|
||||
else:
|
||||
# It can happen that an intent has been renamed. In that case, we should still use the old
|
||||
# name, since we used that to generate the instance_container_info_dict keys.
|
||||
extruder_info.intent_info = instance_container_info_dict[not_upgraded_parser["containers"][str(_ContainerIndexes.Intent)]]
|
||||
|
||||
if not machine_conflict and containers_found_dict["machine"] and global_stack:
|
||||
if int(position) >= len(global_stack.extruderList):
|
||||
|
|
|
@ -10,6 +10,7 @@ if TYPE_CHECKING:
|
|||
|
||||
upgrade = VersionUpgrade52to53.VersionUpgrade52to53()
|
||||
|
||||
|
||||
def getMetaData() -> Dict[str, Any]:
|
||||
return {
|
||||
"version_upgrade": {
|
||||
|
@ -21,6 +22,7 @@ def getMetaData() -> Dict[str, Any]:
|
|||
("quality_changes", 4000020): ("quality_changes", 4000021, upgrade.upgradeInstanceContainer),
|
||||
("quality", 4000020): ("quality", 4000021, upgrade.upgradeInstanceContainer),
|
||||
("user", 4000020): ("user", 4000021, upgrade.upgradeInstanceContainer),
|
||||
("intent", 4000020): ("intent", 4000021, upgrade.upgradeInstanceContainer),
|
||||
},
|
||||
"sources": {
|
||||
"preferences": {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue