mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-03 12:03:57 -06:00
Fix quality lookup logic for extruders
CURA-5694 - Add convenience functions into GlobalStack - Use "has_variants" and "has_materials" instead of "has_variant_materials" - Remove "has_variant_materials" - For extruder qualities, skip global qualities if the machine has variants or materials
This commit is contained in:
parent
d3356cdba6
commit
9aea0e5109
6 changed files with 13 additions and 7 deletions
|
@ -200,7 +200,9 @@ class QualityManager(QObject):
|
|||
machine_definition_id = getMachineDefinitionIDForQualitySearch(machine.definition)
|
||||
|
||||
# This determines if we should only get the global qualities for the global stack and skip the global qualities for the extruder stacks
|
||||
has_variant_materials = parseBool(machine.getMetaDataEntry("has_variant_materials", False))
|
||||
has_variants = machine.getHasVariants()
|
||||
has_materials = machine.getHasMaterials()
|
||||
has_variants_or_materials = has_variants or has_materials
|
||||
|
||||
# To find the quality container for the GlobalStack, check in the following fall-back manner:
|
||||
# (1) the machine-specific node
|
||||
|
@ -214,7 +216,7 @@ class QualityManager(QObject):
|
|||
for node in nodes_to_check:
|
||||
if node and node.quality_type_map:
|
||||
# Only include global qualities
|
||||
if has_variant_materials:
|
||||
if has_variants_or_materials:
|
||||
quality_node = list(node.quality_type_map.values())[0]
|
||||
is_global_quality = parseBool(quality_node.metadata.get("global_quality", False))
|
||||
if not is_global_quality:
|
||||
|
@ -302,7 +304,7 @@ class QualityManager(QObject):
|
|||
|
||||
for node in nodes_to_check:
|
||||
if node and node.quality_type_map:
|
||||
if has_variant_materials:
|
||||
if has_variants_or_materials:
|
||||
# Only include variant qualities; skip non global qualities
|
||||
quality_node = list(node.quality_type_map.values())[0]
|
||||
is_global_quality = parseBool(quality_node.metadata.get("global_quality", False))
|
||||
|
|
|
@ -13,6 +13,8 @@ from UM.Settings.SettingInstance import InstanceState
|
|||
from UM.Settings.ContainerRegistry import ContainerRegistry
|
||||
from UM.Settings.Interfaces import PropertyEvaluationContext
|
||||
from UM.Logger import Logger
|
||||
from UM.Util import parseBool
|
||||
|
||||
import cura.CuraApplication
|
||||
|
||||
from . import Exceptions
|
||||
|
@ -188,6 +190,12 @@ class GlobalStack(CuraContainerStack):
|
|||
def getHeadAndFansCoordinates(self):
|
||||
return self.getProperty("machine_head_with_fans_polygon", "value")
|
||||
|
||||
def getHasMaterials(self) -> bool:
|
||||
return parseBool(self.getMetaDataEntry("has_materials", False))
|
||||
|
||||
def getHasVariants(self) -> bool:
|
||||
return parseBool(self.getMetaDataEntry("has_variants", False))
|
||||
|
||||
|
||||
## private:
|
||||
global_stack_mime = MimeType(
|
||||
|
|
|
@ -11,7 +11,6 @@
|
|||
"has_machine_quality": true,
|
||||
"has_materials": true,
|
||||
"has_machine_materials": true,
|
||||
"has_variant_materials": true,
|
||||
"has_variants": true,
|
||||
|
||||
"variants_name": "Tool",
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
"has_machine_quality": true,
|
||||
"has_materials": true,
|
||||
"has_machine_materials": true,
|
||||
"has_variant_materials": true,
|
||||
"has_variants": true,
|
||||
"preferred_variant_name": "AA 0.4",
|
||||
"preferred_quality_type": "normal",
|
||||
|
|
|
@ -13,7 +13,6 @@
|
|||
"platform_offset": [0, 0, 0],
|
||||
"has_machine_quality": true,
|
||||
"has_machine_materials": true,
|
||||
"has_variant_materials": true,
|
||||
"has_materials": true,
|
||||
"has_variants": true,
|
||||
"preferred_variant_name": "AA 0.4",
|
||||
|
|
|
@ -15,7 +15,6 @@
|
|||
"has_machine_quality": true,
|
||||
"has_materials": true,
|
||||
"has_machine_materials": true,
|
||||
"has_variant_materials": true,
|
||||
"has_variant_buildplates": true,
|
||||
"has_variants": true,
|
||||
"preferred_variant_name": "AA 0.4",
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue