mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-21 05:37:50 -06:00
Return newly added single extruder
The workspace reader needs to use it to get the correct material. Contributes to issue CURA-4604.
This commit is contained in:
parent
fe016e336d
commit
105d7a5615
2 changed files with 4 additions and 2 deletions
|
@ -409,7 +409,7 @@ class CuraContainerRegistry(ContainerRegistry):
|
||||||
extruder_stack = None
|
extruder_stack = None
|
||||||
|
|
||||||
# if extruders are defined in the machine definition use those instead
|
# if extruders are defined in the machine definition use those instead
|
||||||
if machine.extruders and len(machine.extruders) > 0:
|
if machine.extruders and "0" in machine.extruders:
|
||||||
new_extruder_id = machine.extruders["0"].getId()
|
new_extruder_id = machine.extruders["0"].getId()
|
||||||
extruder_stack = machine.extruders["0"]
|
extruder_stack = machine.extruders["0"]
|
||||||
|
|
||||||
|
@ -457,6 +457,8 @@ class CuraContainerRegistry(ContainerRegistry):
|
||||||
|
|
||||||
self.addContainer(extruder_stack)
|
self.addContainer(extruder_stack)
|
||||||
|
|
||||||
|
return extruder_stack
|
||||||
|
|
||||||
# Fix the extruders that were upgraded to ExtruderStack instances during addContainer.
|
# Fix the extruders that were upgraded to ExtruderStack instances during addContainer.
|
||||||
# The stacks are now responsible for setting the next stack on deserialize. However,
|
# The stacks are now responsible for setting the next stack on deserialize. However,
|
||||||
# due to problems with loading order, some stacks may not have the proper next stack
|
# due to problems with loading order, some stacks may not have the proper next stack
|
||||||
|
|
|
@ -746,7 +746,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
||||||
# If not extruder stacks were saved in the project file (pre 3.1) create one manually
|
# If not extruder stacks were saved in the project file (pre 3.1) create one manually
|
||||||
# We re-use the container registry's addExtruderStackForSingleExtrusionMachine method for this
|
# We re-use the container registry's addExtruderStackForSingleExtrusionMachine method for this
|
||||||
if not extruder_stacks:
|
if not extruder_stacks:
|
||||||
self._container_registry.addExtruderStackForSingleExtrusionMachine(global_stack, "fdmextruder")
|
extruder_stacks.append(self._container_registry.addExtruderStackForSingleExtrusionMachine(global_stack, "fdmextruder"))
|
||||||
|
|
||||||
except:
|
except:
|
||||||
Logger.logException("w", "We failed to serialize the stack. Trying to clean up.")
|
Logger.logException("w", "We failed to serialize the stack. Trying to clean up.")
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue