mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 14:55:58 +08:00
Add default for extruder position
The position argument metadata always be there. However if it's not (because the file is old, or manually modified, or a version upgrade worked incorrectly, or whatever) then we shouldn't crash. We just don't know how to order it correctly then. This tries to repair it as best it can.
This commit is contained in:
parent
79cc6ec897
commit
ffac9adb96
@ -226,7 +226,7 @@ class CuraContainerRegistry(ContainerRegistry):
|
||||
global_profile = profile
|
||||
else:
|
||||
extruder_profiles.append(profile)
|
||||
extruder_profiles = sorted(extruder_profiles, key = lambda x: int(x.getMetaDataEntry("position")))
|
||||
extruder_profiles = sorted(extruder_profiles, key = lambda x: int(x.getMetaDataEntry("position", default = "0")))
|
||||
profile_or_list = [global_profile] + extruder_profiles
|
||||
|
||||
if not global_profile:
|
||||
|
Loading…
x
Reference in New Issue
Block a user