mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 06:28:59 +08:00
Fix profile importing for version upgrade
CURA-4946
This commit is contained in:
parent
05c034558d
commit
1f08accbec
@ -241,7 +241,7 @@ class CuraContainerRegistry(ContainerRegistry):
|
||||
profile.addMetaDataEntry("type", "quality_changes")
|
||||
profile.addMetaDataEntry("definition", global_profile.getMetaDataEntry("definition"))
|
||||
profile.addMetaDataEntry("quality_type", global_profile.getMetaDataEntry("quality_type"))
|
||||
profile.addMetaDataEntry("extruder", extruder.getId())
|
||||
profile.addMetaDataEntry("position", "0")
|
||||
profile.setDirty(True)
|
||||
if idx == 0:
|
||||
# move all per-extruder settings to the first extruder's quality_changes
|
||||
@ -273,10 +273,11 @@ class CuraContainerRegistry(ContainerRegistry):
|
||||
elif profile_index < len(machine_extruders) + 1:
|
||||
# This is assumed to be an extruder profile
|
||||
extruder_id = machine_extruders[profile_index - 1].definition.getId()
|
||||
if not profile.getMetaDataEntry("extruder"):
|
||||
profile.addMetaDataEntry("extruder", extruder_id)
|
||||
extuder_position = str(profile_index - 1)
|
||||
if not profile.getMetaDataEntry("position"):
|
||||
profile.addMetaDataEntry("position", extuder_position)
|
||||
else:
|
||||
profile.setMetaDataEntry("extruder", extruder_id)
|
||||
profile.setMetaDataEntry("position", extuder_position)
|
||||
profile_id = (extruder_id + "_" + name_seed).lower().replace(" ", "_")
|
||||
|
||||
else: #More extruders in the imported file than in the machine.
|
||||
|
Loading…
x
Reference in New Issue
Block a user