mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-08-03 03:54:01 -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)
|
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
|
# 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:
|
# To find the quality container for the GlobalStack, check in the following fall-back manner:
|
||||||
# (1) the machine-specific node
|
# (1) the machine-specific node
|
||||||
|
@ -214,7 +216,7 @@ class QualityManager(QObject):
|
||||||
for node in nodes_to_check:
|
for node in nodes_to_check:
|
||||||
if node and node.quality_type_map:
|
if node and node.quality_type_map:
|
||||||
# Only include global qualities
|
# Only include global qualities
|
||||||
if has_variant_materials:
|
if has_variants_or_materials:
|
||||||
quality_node = list(node.quality_type_map.values())[0]
|
quality_node = list(node.quality_type_map.values())[0]
|
||||||
is_global_quality = parseBool(quality_node.metadata.get("global_quality", False))
|
is_global_quality = parseBool(quality_node.metadata.get("global_quality", False))
|
||||||
if not is_global_quality:
|
if not is_global_quality:
|
||||||
|
@ -302,7 +304,7 @@ class QualityManager(QObject):
|
||||||
|
|
||||||
for node in nodes_to_check:
|
for node in nodes_to_check:
|
||||||
if node and node.quality_type_map:
|
if node and node.quality_type_map:
|
||||||
if has_variant_materials:
|
if has_variants_or_materials:
|
||||||
# Only include variant qualities; skip non global qualities
|
# Only include variant qualities; skip non global qualities
|
||||||
quality_node = list(node.quality_type_map.values())[0]
|
quality_node = list(node.quality_type_map.values())[0]
|
||||||
is_global_quality = parseBool(quality_node.metadata.get("global_quality", False))
|
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.ContainerRegistry import ContainerRegistry
|
||||||
from UM.Settings.Interfaces import PropertyEvaluationContext
|
from UM.Settings.Interfaces import PropertyEvaluationContext
|
||||||
from UM.Logger import Logger
|
from UM.Logger import Logger
|
||||||
|
from UM.Util import parseBool
|
||||||
|
|
||||||
import cura.CuraApplication
|
import cura.CuraApplication
|
||||||
|
|
||||||
from . import Exceptions
|
from . import Exceptions
|
||||||
|
@ -188,6 +190,12 @@ class GlobalStack(CuraContainerStack):
|
||||||
def getHeadAndFansCoordinates(self):
|
def getHeadAndFansCoordinates(self):
|
||||||
return self.getProperty("machine_head_with_fans_polygon", "value")
|
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:
|
## private:
|
||||||
global_stack_mime = MimeType(
|
global_stack_mime = MimeType(
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
"has_machine_quality": true,
|
"has_machine_quality": true,
|
||||||
"has_materials": true,
|
"has_materials": true,
|
||||||
"has_machine_materials": true,
|
"has_machine_materials": true,
|
||||||
"has_variant_materials": true,
|
|
||||||
"has_variants": true,
|
"has_variants": true,
|
||||||
|
|
||||||
"variants_name": "Tool",
|
"variants_name": "Tool",
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
"has_machine_quality": true,
|
"has_machine_quality": true,
|
||||||
"has_materials": true,
|
"has_materials": true,
|
||||||
"has_machine_materials": true,
|
"has_machine_materials": true,
|
||||||
"has_variant_materials": true,
|
|
||||||
"has_variants": true,
|
"has_variants": true,
|
||||||
"preferred_variant_name": "AA 0.4",
|
"preferred_variant_name": "AA 0.4",
|
||||||
"preferred_quality_type": "normal",
|
"preferred_quality_type": "normal",
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
"platform_offset": [0, 0, 0],
|
"platform_offset": [0, 0, 0],
|
||||||
"has_machine_quality": true,
|
"has_machine_quality": true,
|
||||||
"has_machine_materials": true,
|
"has_machine_materials": true,
|
||||||
"has_variant_materials": true,
|
|
||||||
"has_materials": true,
|
"has_materials": true,
|
||||||
"has_variants": true,
|
"has_variants": true,
|
||||||
"preferred_variant_name": "AA 0.4",
|
"preferred_variant_name": "AA 0.4",
|
||||||
|
|
|
@ -15,7 +15,6 @@
|
||||||
"has_machine_quality": true,
|
"has_machine_quality": true,
|
||||||
"has_materials": true,
|
"has_materials": true,
|
||||||
"has_machine_materials": true,
|
"has_machine_materials": true,
|
||||||
"has_variant_materials": true,
|
|
||||||
"has_variant_buildplates": true,
|
"has_variant_buildplates": true,
|
||||||
"has_variants": true,
|
"has_variants": true,
|
||||||
"preferred_variant_name": "AA 0.4",
|
"preferred_variant_name": "AA 0.4",
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue