mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-14 18:27:51 -06:00
Fix quality_changes for single-extrusion machines
CURA-4839 - Add newly created quality_changes container to ContainerRegistry - If an extruder is created by CuraContainerRegistry, in project loading, do not try to override extruder's quality changes.
This commit is contained in:
parent
e7a19bcce5
commit
b92ebadfd0
2 changed files with 25 additions and 19 deletions
|
@ -562,8 +562,8 @@ class CuraContainerRegistry(ContainerRegistry):
|
|||
extruder_stack.setQualityChangesById(quality_changes_id)
|
||||
else:
|
||||
# if we still cannot find a quality changes container for the extruder, create a new one
|
||||
container_id = self.uniqueName(extruder_stack.getId() + "_user")
|
||||
container_name = machine.qualityChanges.getName()
|
||||
container_id = self.uniqueName(extruder_stack.getId() + "_qc_" + container_name)
|
||||
extruder_quality_changes_container = InstanceContainer(container_id)
|
||||
extruder_quality_changes_container.setName(container_name)
|
||||
extruder_quality_changes_container.addMetaDataEntry("type", "quality_changes")
|
||||
|
@ -572,6 +572,9 @@ class CuraContainerRegistry(ContainerRegistry):
|
|||
extruder_quality_changes_container.addMetaDataEntry("quality_type", machine.qualityChanges.getMetaDataEntry("quality_type"))
|
||||
extruder_quality_changes_container.setDefinition(machine.qualityChanges.getDefinition().getId())
|
||||
|
||||
self.addContainer(extruder_quality_changes_container)
|
||||
extruder_stack.qualityChanges = extruder_quality_changes_container
|
||||
|
||||
if not extruder_quality_changes_container:
|
||||
Logger.log("w", "Could not find quality_changes named [%s] for extruder [%s]",
|
||||
machine.qualityChanges.getName(), extruder_stack.getId())
|
||||
|
|
|
@ -703,6 +703,7 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
|||
return
|
||||
|
||||
# load extruder stack files
|
||||
has_extruder_stack_files = len(extruder_stack_files) > 0
|
||||
try:
|
||||
for extruder_stack_file in extruder_stack_files:
|
||||
container_id = self._stripFileToId(extruder_stack_file)
|
||||
|
@ -946,6 +947,8 @@ class ThreeMFWorkspaceReader(WorkspaceReader):
|
|||
continue
|
||||
|
||||
# Replace the quality/definition changes container if it's in one of the ExtruderStacks
|
||||
# Only apply the change if we have loaded extruder stacks from the project
|
||||
if has_extruder_stack_files:
|
||||
for each_extruder_stack in extruder_stacks:
|
||||
changes_container = None
|
||||
if changes_container_type == "quality_changes":
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue