mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 14:44:13 -06:00
Added way to dynamicly set loading order
This is to ensure that Global stacks are loaded before extruders, so once the extruders are deseralized, they can always find the next (global) stack CURA-3497
This commit is contained in:
parent
58ab9dcd09
commit
8d80f20db7
2 changed files with 15 additions and 0 deletions
|
@ -38,6 +38,10 @@ class ExtruderStack(CuraContainerStack):
|
|||
# For backward compatibility: Register the extruder with the Extruder Manager
|
||||
ExtruderManager.getInstance().registerExtruder(self, stack.id)
|
||||
|
||||
@classmethod
|
||||
def getLoadingPriority(cls) -> int:
|
||||
return 3
|
||||
|
||||
## Overridden from ContainerStack
|
||||
#
|
||||
# It will perform a few extra checks when trying to get properties.
|
||||
|
@ -64,6 +68,13 @@ class ExtruderStack(CuraContainerStack):
|
|||
|
||||
return self.getNextStack()._getMachineDefinition()
|
||||
|
||||
@override(CuraContainerStack)
|
||||
def deserialize(self, contents: str) -> None:
|
||||
super().deserialize(contents)
|
||||
stacks = ContainerRegistry.getInstance().findContainerStacks(id=self.getMetaDataEntry("machine", ""))
|
||||
if stacks:
|
||||
self.setNextStack(stacks[0])
|
||||
|
||||
extruder_stack_mime = MimeType(
|
||||
name = "application/x-cura-extruderstack",
|
||||
comment = "Cura Extruder Stack",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue