Fallback to fdmprinter if not has_machine_quality

Contributes to issue CURA-6847.
This commit is contained in:
Ghostkeeper 2019-10-03 16:25:09 +02:00
parent 877bb1efdb
commit 38ae0e75f2
No known key found for this signature in database
GPG Key ID: 86BEF881AE2CF276

View File

@ -21,6 +21,7 @@ from UM.Message import Message
from UM.Platform import Platform from UM.Platform import Platform
from UM.PluginRegistry import PluginRegistry # For getting the possible profile writers to write with. from UM.PluginRegistry import PluginRegistry # For getting the possible profile writers to write with.
from UM.Resources import Resources from UM.Resources import Resources
from UM.Util import parseBool
from cura.ReaderWriters.ProfileWriter import ProfileWriter from cura.ReaderWriters.ProfileWriter import ProfileWriter
from . import ExtruderStack from . import ExtruderStack
@ -238,7 +239,8 @@ class CuraContainerRegistry(ContainerRegistry):
# Get the expected machine definition. # Get the expected machine definition.
# i.e.: We expect gcode for a UM2 Extended to be defined as normal UM2 gcode... # i.e.: We expect gcode for a UM2 Extended to be defined as normal UM2 gcode...
profile_definition = machine_definition.getMetaDataEntry("quality_definition", machine_definition.getId()) has_machine_quality = parseBool(machine_definition.getMetaDataEntry("has_machine_quality", "false"))
profile_definition = machine_definition.getMetaDataEntry("quality_definition", machine_definition.getId()) if has_machine_quality else "fdmprinter"
expected_machine_definition = container_tree.machines[global_stack.definition.getId()].quality_definition expected_machine_definition = container_tree.machines[global_stack.definition.getId()].quality_definition
# And check if the profile_definition matches either one (showing error if not): # And check if the profile_definition matches either one (showing error if not):