CURA-4839 Fix single extrusing for overrite the extruder stack.

This commit is contained in:
Diego Prado Gesto 2018-01-22 15:02:55 +01:00
parent 20ab6265c8
commit 619a8ccce5

View file

@ -754,14 +754,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:
if self._resolve_strategies["machine"] == "new":
stack = self._container_registry.addExtruderStackForSingleExtrusionMachine(global_stack, "fdmextruder") stack = self._container_registry.addExtruderStackForSingleExtrusionMachine(global_stack, "fdmextruder")
else:
stack = global_stack.extruders.get("0")
if not stack:
# this should not happen
Logger.log("e", "Cannot find any extruder in an existing global stack [%s].", global_stack.getId())
if stack:
if global_stack.quality.getId() in ("empty", "empty_quality"): if global_stack.quality.getId() in ("empty", "empty_quality"):
stack.quality = empty_quality_container stack.quality = empty_quality_container
if self._resolve_strategies["machine"] == "override": if self._resolve_strategies["machine"] == "override":
@ -870,7 +863,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
# We will first find the correct quality profile for the extruder, then apply the same # We will first find the correct quality profile for the extruder, then apply the same
# quality profile for the global stack. # quality profile for the global stack.
# #
if len(extruder_stacks) == 1: if has_extruder_stack_files and len(extruder_stacks) == 1:
extruder_stack = extruder_stacks[0] extruder_stack = extruder_stacks[0]
search_criteria = {"type": "quality", "quality_type": global_stack.quality.getMetaDataEntry("quality_type")} search_criteria = {"type": "quality", "quality_type": global_stack.quality.getMetaDataEntry("quality_type")}