mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-04 11:14:21 +08:00
Cache global container stack
We'll need it multiple times. Could be a bit faster. Contributes to issue CURA-2785.
This commit is contained in:
parent
35f43df2f6
commit
06521d7c49
@ -66,8 +66,9 @@ class LegacyProfileReader(ProfileReader):
|
||||
def read(self, file_name):
|
||||
if file_name.split(".")[-1] != "ini":
|
||||
return None
|
||||
global_container_stack = Application.getInstance().getGlobalContainerStack()
|
||||
|
||||
multi_extrusion = Application.getInstance().getGlobalContainerStack().getProperty("machine_extruder_count", "value") > 1
|
||||
multi_extrusion = global_container_stack.getProperty("machine_extruder_count", "value") > 1
|
||||
if multi_extrusion:
|
||||
Logger.log("e", "Unable to import legacy profile %s. Multi extrusion is not supported", file_name)
|
||||
raise Exception("Unable to import legacy profile. Multi extrusion is not supported")
|
||||
@ -117,7 +118,7 @@ class LegacyProfileReader(ProfileReader):
|
||||
if "translation" not in dict_of_doom:
|
||||
Logger.log("e", "Dictionary of Doom has no translation. Is it the correct JSON file?")
|
||||
return None
|
||||
current_printer_definition = Application.getInstance().getGlobalContainerStack().getBottom()
|
||||
current_printer_definition = global_container_stack.getBottom()
|
||||
profile.setDefinition(current_printer_definition)
|
||||
for new_setting in dict_of_doom["translation"]: #Evaluate all new settings that would get a value from the translations.
|
||||
old_setting_expression = dict_of_doom["translation"][new_setting]
|
||||
|
Loading…
x
Reference in New Issue
Block a user