diff --git a/cura/Machines/MaterialManager.py b/cura/Machines/MaterialManager.py index b65e01487c..880ef399bf 100644 --- a/cura/Machines/MaterialManager.py +++ b/cura/Machines/MaterialManager.py @@ -249,15 +249,15 @@ class MaterialManager(QObject): # 1. variant-specific material # 2. machine-specific material # 3. generic material (for fdmprinter) - material_node = None - if variant_node is not None: - if root_material_id in variant_node.material_map: - material_node = variant_node.material_map.get(root_material_id) + nodes_to_check = [variant_node, machine_node, + machine_variant_material_map.get(self._default_machine_definition_id)] - # Fallback: machine-specific materials, including "fdmprinter" - if material_node is None: - if machine_node is not None: - material_node = machine_node.material_map.get(root_material_id) + material_node = None + for node in nodes_to_check: + if node is not None: + material_node = node.material_map.get(root_material_id) + if material_node: + break return material_node diff --git a/cura/Machines/QualityManager.py b/cura/Machines/QualityManager.py index ee8b9c8922..132c2e3dfa 100644 --- a/cura/Machines/QualityManager.py +++ b/cura/Machines/QualityManager.py @@ -320,7 +320,7 @@ class QualityManager(QObject): # No suitable quality found: not supported Logger.log("d", "Cannot find quality with machine [%s], variant name [%s], and materials [%s].", machine_definition_id, variant_name, ", ".join(root_material_id_list)) - continue + else: # In this case, we only have a specific material but NOT a variant if has_material: @@ -332,7 +332,6 @@ class QualityManager(QObject): # No suitable quality found: not supported Logger.log("d", "Cannot find quality with machine [%s], variant name [%s], and materials [%s].", machine_definition_id, variant_name, ", ".join(root_material_id_list)) - continue node_to_check = material_node if not node_to_check: diff --git a/resources/definitions/anycubic_i3_mega.def.json b/resources/definitions/anycubic_i3_mega.def.json index cba868900c..7106038193 100644 --- a/resources/definitions/anycubic_i3_mega.def.json +++ b/resources/definitions/anycubic_i3_mega.def.json @@ -12,7 +12,7 @@ "platform": "anycubic_i3_mega_platform.stl", "has_materials": false, "has_machine_quality": true, - "preferred_quality": "*normal*" + "preferred_quality_type": "normal" }, "overrides": diff --git a/resources/definitions/builder_premium_large.def.json b/resources/definitions/builder_premium_large.def.json index b496dc524e..deb1539a9a 100644 --- a/resources/definitions/builder_premium_large.def.json +++ b/resources/definitions/builder_premium_large.def.json @@ -12,16 +12,14 @@ "platform": "builder_premium_platform.stl", "platform_offset": [-126, -36, 117], "has_machine_quality": true, - "preferred_quality": "*Normal*", + "preferred_quality_type": "normal", "machine_extruder_trains": { "0": "builder_premium_large_rear", "1": "builder_premium_large_front" } }, - - - + "overrides": { "machine_name": { "default_value": "Builder Premium Large" }, "machine_heated_bed": { "default_value": true }, @@ -36,7 +34,7 @@ "default_material_print_temperature": { "value": "215" }, "material_print_temperature_layer_0": { "value": "material_print_temperature + 5" }, "material_standby_temperature": { "value": "material_print_temperature" }, - + "switch_extruder_retraction_speeds": {"default_value": 15 }, "switch_extruder_retraction_speed": {"default_value": 15 }, "switch_extruder_prime_speed": {"default_value": 15 }, @@ -58,9 +56,9 @@ "prime_tower_wipe_enabled": { "default_value": false }, "prime_tower_min_volume": { "default_value": 50 }, "dual_pre_wipe": { "default_value": false }, - + "prime_blob_enable": { "enabled": true }, - + "acceleration_enabled": { "value": "True" }, "acceleration_layer_0": { "value": "acceleration_topbottom" }, "acceleration_prime_tower": { "value": "math.ceil(acceleration_print * 2000 / 4000)" }, @@ -71,7 +69,7 @@ "acceleration_travel": { "value": "acceleration_print" }, "acceleration_wall": { "value": "math.ceil(acceleration_print * 1000 / 3000)" }, "acceleration_wall_0": { "value": "math.ceil(acceleration_wall * 1000 / 1000)" }, - + "cool_fan_full_at_height": { "value": "layer_height_0 + 2 * layer_height" }, "cool_min_layer_time": { "default_value": 10 }, @@ -84,9 +82,9 @@ "jerk_topbottom": { "value": "math.ceil(jerk_print * 5 / 25)" }, "jerk_wall": { "value": "math.ceil(jerk_print * 10 / 25)" }, "jerk_wall_0": { "value": "math.ceil(jerk_wall * 5 / 10)" }, - + "wall_thickness": { "value": "1.2" }, - + "retraction_amount": { "default_value": 3 }, "retraction_speed": { "default_value": 15 }, "retraction_retract_speed": { "default_value": 15 }, @@ -113,4 +111,4 @@ }, "machine_extruder_count": { "default_value": 2 } } -} \ No newline at end of file +} diff --git a/resources/definitions/builder_premium_medium.def.json b/resources/definitions/builder_premium_medium.def.json index fe8a039fc4..c28c7c5de6 100644 --- a/resources/definitions/builder_premium_medium.def.json +++ b/resources/definitions/builder_premium_medium.def.json @@ -12,16 +12,14 @@ "platform": "builder_premium_platform.stl", "platform_offset": [-126, -36, 117], "has_machine_quality": true, - "preferred_quality": "*Normal*", + "preferred_quality_type": "normal", "machine_extruder_trains": { "0": "builder_premium_medium_rear", "1": "builder_premium_medium_front" } }, - - - + "overrides": { "machine_name": { "default_value": "Builder Premium Medium" }, "machine_heated_bed": { "default_value": true }, @@ -36,7 +34,7 @@ "default_material_print_temperature": { "value": "215" }, "material_print_temperature_layer_0": { "value": "material_print_temperature + 5" }, "material_standby_temperature": { "value": "material_print_temperature" }, - + "switch_extruder_retraction_speeds": {"default_value": 15 }, "switch_extruder_retraction_speed": {"default_value": 15 }, "switch_extruder_prime_speed": {"default_value": 15 }, @@ -58,9 +56,9 @@ "prime_tower_wipe_enabled": { "default_value": false }, "prime_tower_min_volume": { "default_value": 50 }, "dual_pre_wipe": { "default_value": false }, - + "prime_blob_enable": { "enabled": true }, - + "acceleration_enabled": { "value": "True" }, "acceleration_layer_0": { "value": "acceleration_topbottom" }, "acceleration_prime_tower": { "value": "math.ceil(acceleration_print * 2000 / 4000)" }, @@ -71,7 +69,7 @@ "acceleration_travel": { "value": "acceleration_print" }, "acceleration_wall": { "value": "math.ceil(acceleration_print * 1000 / 3000)" }, "acceleration_wall_0": { "value": "math.ceil(acceleration_wall * 1000 / 1000)" }, - + "cool_fan_full_at_height": { "value": "layer_height_0 + 2 * layer_height" }, "cool_min_layer_time": { "default_value": 10 }, @@ -84,9 +82,9 @@ "jerk_topbottom": { "value": "math.ceil(jerk_print * 5 / 25)" }, "jerk_wall": { "value": "math.ceil(jerk_print * 10 / 25)" }, "jerk_wall_0": { "value": "math.ceil(jerk_wall * 5 / 10)" }, - + "wall_thickness": { "value": "1.2" }, - + "retraction_amount": { "default_value": 3 }, "retraction_speed": { "default_value": 15 }, "retraction_retract_speed": { "default_value": 15 }, @@ -113,4 +111,4 @@ }, "machine_extruder_count": { "default_value": 2 } } -} \ No newline at end of file +} diff --git a/resources/definitions/builder_premium_small.def.json b/resources/definitions/builder_premium_small.def.json index a1660b63cf..8e2fe44631 100644 --- a/resources/definitions/builder_premium_small.def.json +++ b/resources/definitions/builder_premium_small.def.json @@ -11,16 +11,14 @@ "platform": "builder_premium_platform.stl", "platform_offset": [-126, -36, 117], "has_machine_quality": true, - "preferred_quality": "*Normal*", + "preferred_quality_type": "normal", "machine_extruder_trains": { "0": "builder_premium_small_rear", "1": "builder_premium_small_front" } }, - - - + "overrides": { "machine_name": { "default_value": "Builder Premium Small" }, "machine_heated_bed": { "default_value": true }, @@ -35,7 +33,7 @@ "default_material_print_temperature": { "value": "215" }, "material_print_temperature_layer_0": { "value": "material_print_temperature + 5" }, "material_standby_temperature": { "value": "material_print_temperature" }, - + "switch_extruder_retraction_speeds": {"default_value": 15 }, "switch_extruder_retraction_speed": {"default_value": 15 }, "switch_extruder_prime_speed": {"default_value": 15 }, @@ -57,9 +55,9 @@ "prime_tower_wipe_enabled": { "default_value": false }, "prime_tower_min_volume": { "default_value": 50 }, "dual_pre_wipe": { "default_value": false }, - + "prime_blob_enable": { "enabled": true }, - + "acceleration_enabled": { "value": "True" }, "acceleration_layer_0": { "value": "acceleration_topbottom" }, "acceleration_prime_tower": { "value": "math.ceil(acceleration_print * 2000 / 4000)" }, @@ -70,7 +68,7 @@ "acceleration_travel": { "value": "acceleration_print" }, "acceleration_wall": { "value": "math.ceil(acceleration_print * 1000 / 3000)" }, "acceleration_wall_0": { "value": "math.ceil(acceleration_wall * 1000 / 1000)" }, - + "cool_fan_full_at_height": { "value": "layer_height_0 + 2 * layer_height" }, "cool_min_layer_time": { "default_value": 10 }, @@ -83,9 +81,9 @@ "jerk_topbottom": { "value": "math.ceil(jerk_print * 5 / 25)" }, "jerk_wall": { "value": "math.ceil(jerk_print * 10 / 25)" }, "jerk_wall_0": { "value": "math.ceil(jerk_wall * 5 / 10)" }, - + "wall_thickness": { "value": "1.2" }, - + "retraction_amount": { "default_value": 3 }, "retraction_speed": { "default_value": 15 }, "retraction_retract_speed": { "default_value": 15 }, @@ -112,4 +110,4 @@ }, "machine_extruder_count": { "default_value": 2 } } -} \ No newline at end of file +} diff --git a/resources/definitions/cartesio.def.json b/resources/definitions/cartesio.def.json index 44f3153015..9deb257ac3 100644 --- a/resources/definitions/cartesio.def.json +++ b/resources/definitions/cartesio.def.json @@ -15,9 +15,8 @@ "has_variants": true, "variants_name": "Nozzle size", - "preferred_variant": "*0.8*", - "preferred_material": "*pla*", - "preferred_quality": "*normal*", + "preferred_variant_name": "0.8 mm", + "preferred_quality_type": "normal", "machine_extruder_trains": { diff --git a/resources/definitions/creality_cr10.def.json b/resources/definitions/creality_cr10.def.json index 7a58adcd4d..eb0b8c7306 100644 --- a/resources/definitions/creality_cr10.def.json +++ b/resources/definitions/creality_cr10.def.json @@ -7,7 +7,7 @@ "author": "Michael Wildermuth", "manufacturer": "Creality3D", "file_formats": "text/x-gcode", - "preferred_quality": "*Draft*" + "preferred_quality_type": "draft" }, "overrides": { "machine_width": { diff --git a/resources/definitions/fabtotum.def.json b/resources/definitions/fabtotum.def.json index 87ce11a35c..a53e9d9efb 100644 --- a/resources/definitions/fabtotum.def.json +++ b/resources/definitions/fabtotum.def.json @@ -13,8 +13,8 @@ "has_machine_quality": true, "has_variants": true, "variants_name": "Head", - "preferred_variant": "*lite04*", - "preferred_material": "*fabtotum_pla*", + "preferred_variant_name": "Lite 0.4 mm", + "preferred_material": "fabtotum_pla", "supports_usb_connection": false }, diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 366158d042..274c13d0f3 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -12,7 +12,6 @@ "visible": false, "has_materials": true, "preferred_material": "generic_pla", - "preferred_quality": "*normal*", "preferred_quality_type": "normal", "machine_extruder_trains": { diff --git a/resources/definitions/gmax15plus.def.json b/resources/definitions/gmax15plus.def.json index d651a86bb3..3a207cd054 100644 --- a/resources/definitions/gmax15plus.def.json +++ b/resources/definitions/gmax15plus.def.json @@ -12,9 +12,7 @@ "platform": "gmax_1-5_xt-plus_s3d_full model_150707.stl", "has_variants": true, "variants_name": "Hotend", - "preferred_variant": "*0.5mm E3D (Default)*" - - + "preferred_variant_name": "0.5mm E3D (Default)" }, "overrides": { diff --git a/resources/definitions/gmax15plus_dual.def.json b/resources/definitions/gmax15plus_dual.def.json index 4e9a91e88d..af26a2e30a 100644 --- a/resources/definitions/gmax15plus_dual.def.json +++ b/resources/definitions/gmax15plus_dual.def.json @@ -12,11 +12,11 @@ "platform": "gmax_1-5_xt-plus_s3d_full model_150707.stl", "has_variants": true, "variants_name": "Hotend", - "preferred_variant": "*0.5mm E3D (Default)*", + "preferred_variant_name": "0.5mm E3D (Default)", "machine_extruder_trains": { "0": "gmax15plus_dual_extruder_0", "1": "gmax15plus_dual_extruder_1" - } + } }, "overrides": { diff --git a/resources/definitions/imade3d_jellybox.def.json b/resources/definitions/imade3d_jellybox.def.json index 11df730408..b234e4b2cd 100644 --- a/resources/definitions/imade3d_jellybox.def.json +++ b/resources/definitions/imade3d_jellybox.def.json @@ -9,9 +9,8 @@ "platform": "imade3d_jellybox_platform.stl", "platform_offset": [ 0, -0.3, 0], "file_formats": "text/x-gcode", - "preferred_variant": "*0.4*", - "preferred_material": "*generic_pla*", - "preferred_quality": "*fast*", + "preferred_variant_name": "0.4 mm", + "preferred_quality_type": "fast", "has_materials": true, "has_variants": true, "has_machine_materials": true, diff --git a/resources/definitions/malyan_m200.def.json b/resources/definitions/malyan_m200.def.json index 365b031c43..a3f4f81ecf 100644 --- a/resources/definitions/malyan_m200.def.json +++ b/resources/definitions/malyan_m200.def.json @@ -11,7 +11,7 @@ "platform": "malyan_m200_platform.stl", "has_machine_quality": true, "has_materials": true, - "preferred_quality": "*normal*", + "preferred_quality_type": "normal", "supports_usb_connection": true, "visible": true, "first_start_actions": ["MachineSettingsAction"], diff --git a/resources/definitions/monoprice_select_mini_v2.def.json b/resources/definitions/monoprice_select_mini_v2.def.json index 87014c136b..99bb7ef50a 100644 --- a/resources/definitions/monoprice_select_mini_v2.def.json +++ b/resources/definitions/monoprice_select_mini_v2.def.json @@ -10,7 +10,7 @@ "file_formats": "text/x-gcode", "has_machine_quality": true, "has_materials": true, - "preferred_quality": "*normal*", + "preferred_quality_type": "normal", "visible": true }, diff --git a/resources/definitions/tevo_blackwidow.def.json b/resources/definitions/tevo_blackwidow.def.json index 04cadfb160..22f7095e17 100644 --- a/resources/definitions/tevo_blackwidow.def.json +++ b/resources/definitions/tevo_blackwidow.def.json @@ -11,7 +11,7 @@ "has_materials": false, "has_machine_quality": true, "platform": "tevo_blackwidow.stl", - "preferred_quality": "*normal*" + "preferred_quality_type": "normal" }, "overrides": { diff --git a/resources/definitions/ultimaker2_plus.def.json b/resources/definitions/ultimaker2_plus.def.json index bc90776289..935bf5b6c0 100644 --- a/resources/definitions/ultimaker2_plus.def.json +++ b/resources/definitions/ultimaker2_plus.def.json @@ -9,7 +9,6 @@ "file_formats": "text/x-gcode", "platform": "ultimaker2_platform.obj", "platform_texture": "Ultimaker2Plusbackplate.png", - "preferred_variant": "*0.4*", "preferred_variant_name": "0.4 mm", "has_variants": true, "has_materials": true, diff --git a/resources/definitions/ultimaker3.def.json b/resources/definitions/ultimaker3.def.json index 9a98b83efb..8fda63f970 100644 --- a/resources/definitions/ultimaker3.def.json +++ b/resources/definitions/ultimaker3.def.json @@ -15,9 +15,7 @@ "has_machine_materials": true, "has_variant_materials": true, "has_variants": true, - "preferred_variant": "*aa04*", "preferred_variant_name": "AA 0.4", - "preferred_quality": "*Normal*", "preferred_quality_type": "normal", "variants_name": "Print core", "machine_extruder_trains": diff --git a/resources/definitions/ultimaker3_extended.def.json b/resources/definitions/ultimaker3_extended.def.json index 385199f4f1..3a1be3a303 100644 --- a/resources/definitions/ultimaker3_extended.def.json +++ b/resources/definitions/ultimaker3_extended.def.json @@ -16,7 +16,7 @@ "has_variant_materials": true, "has_materials": true, "has_variants": true, - "preferred_variant": "*aa04*", + "preferred_variant_name": "AA 0.4", "variants_name": "Print core", "machine_extruder_trains": {