mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-23 14:19:37 +08:00
Add support for global quality profiles
Instead of using one of the extruder profiles as global quality, use proper global qualities. Contributes to CURA-2646
This commit is contained in:
parent
2bff94ba9f
commit
e82b2c0f80
@ -82,8 +82,9 @@ class QualityManager:
|
||||
# \param material_containers (Optional) \type{List[ContainerInstance]} If nothing is specified then
|
||||
# the current set of selected materials is used.
|
||||
# \return the matching quality container \type{ContainerInstance}
|
||||
def findQualityByQualityType(self, quality_type, machine_definition=None, material_containers=None):
|
||||
criteria = {"type": "quality"}
|
||||
def findQualityByQualityType(self, quality_type, machine_definition=None, material_containers=None, **kwargs):
|
||||
criteria = kwargs
|
||||
criteria["type"] = "quality"
|
||||
if quality_type:
|
||||
criteria["quality_type"] = quality_type
|
||||
result = self._getFilteredContainersForStack(machine_definition, material_containers, **criteria)
|
||||
@ -218,7 +219,7 @@ class QualityManager:
|
||||
result = []
|
||||
for container in containers:
|
||||
# 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 and not "global_quality" in kwargs:
|
||||
continue
|
||||
result.append(container)
|
||||
return result
|
||||
|
@ -769,8 +769,13 @@ class MachineManager(QObject):
|
||||
|
||||
if extruder_stacks:
|
||||
# Add an extra entry for the global stack.
|
||||
result.append({"stack": global_container_stack, "quality": result[0]["quality"],
|
||||
"quality_changes": empty_quality_changes})
|
||||
global_quality = quality_manager.findQualityByQualityType(quality_type, global_machine_definition, [], global_quality = "True")
|
||||
|
||||
if not global_quality:
|
||||
global_quality = self._empty_quality_container
|
||||
|
||||
result.append({"stack": global_container_stack, "quality": global_quality, "quality_changes": empty_quality_changes})
|
||||
|
||||
return result
|
||||
|
||||
## Determine the quality and quality changes settings for the current machine for a quality changes name.
|
||||
|
Loading…
x
Reference in New Issue
Block a user