mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 17:59:00 +08:00
WIP: Add temporary fix to make materials work with 2.7 version upgrade
CURA-3975 This is a temporary fix to make materials work with 2.7 version upgrade because of the setting_version change from 1 to 2. This MUST be fixed after we have decided on how to determine the versions of an XMLMaterialProfile.
This commit is contained in:
parent
5bf080950f
commit
b4949a164c
@ -36,6 +36,10 @@ class XmlMaterialProfile(InstanceContainer):
|
||||
# \param xml_version: The version number found in an XML file.
|
||||
# \return The corresponding setting_version.
|
||||
def xmlVersionToSettingVersion(self, xml_version: str) -> int:
|
||||
if xml_version == "1.3":
|
||||
return 2 # FIXME & HACK: This is temporary hack. The setting_version has been increased in CuraApplication,
|
||||
# but we haven't decided on how to determine the versions of an XMLMaterialProfile yet.
|
||||
# This MUST be fixed after the decision has been made.
|
||||
if xml_version == "1.3":
|
||||
return 1
|
||||
return 0 #Older than 1.3.
|
||||
|
@ -20,6 +20,10 @@ class XmlMaterialUpgrader(VersionUpgrade):
|
||||
return version * 1000000 + setting_version
|
||||
|
||||
def _xmlVersionToSettingVersion(self, xml_version: str) -> int:
|
||||
if xml_version == "1.3":
|
||||
return 2 # FIXME & HACK: This is temporary hack. The setting_version has been increased in CuraApplication,
|
||||
# but we haven't decided on how to determine the versions of an XMLMaterialProfile yet.
|
||||
# This MUST be fixed after the decision has been made.
|
||||
if xml_version == "1.3":
|
||||
return 1
|
||||
return 0 #Older than 1.3.
|
||||
|
@ -20,6 +20,8 @@ def getMetaData():
|
||||
},
|
||||
"version_upgrade": {
|
||||
("materials", 1000000): ("materials", 1000001, upgrader.upgradeMaterial),
|
||||
# FIXME: This needs to be changed once we have decided on how to determine the versions
|
||||
("materials", 1000001): ("materials", 1000002, upgrader.upgradeMaterial),
|
||||
},
|
||||
"sources": {
|
||||
"materials": {
|
||||
|
Loading…
x
Reference in New Issue
Block a user