mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-25 07:33:57 -06:00
Quality changes didn't have the right extruder ID set in some situations.
CURA-2414 Quality changes profiles are created incorrectly
This commit is contained in:
parent
cd120c6be5
commit
8c8cd86a08
3 changed files with 13 additions and 14 deletions
|
@ -141,12 +141,6 @@ class QualityManager:
|
||||||
for material_instance in material_containers:
|
for material_instance in material_containers:
|
||||||
material_ids.add(material_instance.getId())
|
material_ids.add(material_instance.getId())
|
||||||
|
|
||||||
|
|
||||||
if machine_definition.getMetaDataEntry("type") == "extruder":
|
|
||||||
extruder_id = machine_definition.getId()
|
|
||||||
else:
|
|
||||||
extruder_id = None
|
|
||||||
|
|
||||||
containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(**criteria)
|
containers = UM.Settings.ContainerRegistry.getInstance().findInstanceContainers(**criteria)
|
||||||
|
|
||||||
result = []
|
result = []
|
||||||
|
@ -154,8 +148,6 @@ class QualityManager:
|
||||||
# If the machine specifies we should filter by material, exclude containers that do not match any active material.
|
# If the machine specifies we should filter by material, exclude containers that do not match any active material.
|
||||||
if filter_by_material and container.getMetaDataEntry("material") not in material_ids:
|
if filter_by_material and container.getMetaDataEntry("material") not in material_ids:
|
||||||
continue
|
continue
|
||||||
if extruder_id != container.getMetaDataEntry("extruder"):
|
|
||||||
continue
|
|
||||||
result.append(container)
|
result.append(container)
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
|
@ -476,7 +476,7 @@ class ContainerManager(QObject):
|
||||||
UM.Logger.log("w", "No quality or quality changes container found in stack %s, ignoring it", stack.getId())
|
UM.Logger.log("w", "No quality or quality changes container found in stack %s, ignoring it", stack.getId())
|
||||||
continue
|
continue
|
||||||
|
|
||||||
extruder_id = None if stack is global_stack else stack.getBottom().getId()
|
extruder_id = None if stack is global_stack else QualityManager.getInstance().getParentMachineDefinition(stack.getBottom()).getId()
|
||||||
new_changes = self._createQualityChanges(quality_container, unique_name,
|
new_changes = self._createQualityChanges(quality_container, unique_name,
|
||||||
UM.Application.getInstance().getGlobalContainerStack().getBottom(),
|
UM.Application.getInstance().getGlobalContainerStack().getBottom(),
|
||||||
extruder_id)
|
extruder_id)
|
||||||
|
|
|
@ -687,7 +687,11 @@ class MachineManager(QObject):
|
||||||
|
|
||||||
global_container_stack = self._global_container_stack
|
global_container_stack = self._global_container_stack
|
||||||
global_machine_definition = quality_manager.getParentMachineDefinition(global_container_stack.getBottom())
|
global_machine_definition = quality_manager.getParentMachineDefinition(global_container_stack.getBottom())
|
||||||
global_quality_changes = quality_manager.findQualityChangesByName(quality_changes_name, global_machine_definition)[0]
|
|
||||||
|
quality_changes_profiles = quality_manager.findQualityChangesByName(quality_changes_name,
|
||||||
|
global_machine_definition)
|
||||||
|
|
||||||
|
global_quality_changes = [qcp for qcp in quality_changes_profiles if qcp.getMetaDataEntry("extruder") is None][0]
|
||||||
material = global_container_stack.findContainer(type="material")
|
material = global_container_stack.findContainer(type="material")
|
||||||
|
|
||||||
# For the global stack, find a quality which matches the quality_type in
|
# For the global stack, find a quality which matches the quality_type in
|
||||||
|
@ -697,11 +701,14 @@ class MachineManager(QObject):
|
||||||
|
|
||||||
# Find the values for each extruder.
|
# Find the values for each extruder.
|
||||||
extruder_stacks = ExtruderManager.getInstance().getActiveExtruderStacks()
|
extruder_stacks = ExtruderManager.getInstance().getActiveExtruderStacks()
|
||||||
|
|
||||||
for stack in extruder_stacks:
|
for stack in extruder_stacks:
|
||||||
machine_definition = quality_manager.getParentMachineDefinition(stack.getBottom())
|
extruder_definition = quality_manager.getParentMachineDefinition(stack.getBottom())
|
||||||
quality_changes_profiles = quality_manager.findQualityChangesByName(quality_changes_name, machine_definition)
|
|
||||||
if quality_changes_profiles:
|
quality_changes_list = [qcp for qcp in quality_changes_profiles
|
||||||
quality_changes = quality_changes_profiles[0]
|
if qcp.getMetaDataEntry("extruder") == extruder_definition.getId()]
|
||||||
|
if quality_changes_list:
|
||||||
|
quality_changes = quality_changes_list[0]
|
||||||
else:
|
else:
|
||||||
quality_changes = global_quality_changes
|
quality_changes = global_quality_changes
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue