From 61db7ce4006258c0db1d858702709f5305c23081 Mon Sep 17 00:00:00 2001 From: Randy Zwitch Date: Sat, 15 Jul 2023 13:07:22 -0400 Subject: [PATCH 01/34] Add E444M definition file --- .../matterhackers_pulsexe_e444m.def.json | 62 +++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 resources/definitions/matterhackers_pulsexe_e444m.def.json diff --git a/resources/definitions/matterhackers_pulsexe_e444m.def.json b/resources/definitions/matterhackers_pulsexe_e444m.def.json new file mode 100644 index 0000000000..05757b0679 --- /dev/null +++ b/resources/definitions/matterhackers_pulsexe_e444m.def.json @@ -0,0 +1,62 @@ +{ + "version": 2, + "name": "Pulse XE E-444M", + "inherits": "fdmprinter", + "metadata": + { + "visible": true, + "author": "Zwitch Guitars", + "manufacturer": "MatterHackers", + "file_formats": "text/x-gcode", + "has_materials": true, + "has_variants": false, + "has_machine_quality": false, + "preferred_material": "generic_pla", + "preferred_quality_type": "normal", + "first_start_actions": [ "MachineSettingsAction" ], + "machine_extruder_trains": + { + "0": "matterhackers_extruder" + } + }, + "overrides": + { + "machine_name": { "default_value": "Pulse XE E-444M" }, + "machine_gcode_flavor": { "default_value": "Marlin" }, + "machine_depth": { "default_value": 220 }, + "machine_height": { "default_value": 215 }, + "machine_width": { "default_value": 250 }, + "gantry_height": { "value": 23 }, + "machine_heated_bed": { "default_value": true }, + "machine_head_with_fans_polygon": + { + "default_value": [[-28, 45], [-28, -18], [40, 45], [40, -18]] + }, + "machine_steps_per_mm_x": {"value": 80}, + "machine_steps_per_mm_y": {"value": 80}, + "machine_steps_per_mm_z": {"value": 400}, + "machine_steps_per_mm_e": {"value": 415}, + "machine_max_feedrate_x": {"value": 300}, + "machine_max_feedrate_y": {"value": 300}, + "machine_max_feedrate_z": {"value": 30}, + "machine_max_feedrate_e": {"value": 75}, + "machine_acceleration": {"value": 1300}, + "material_diameter": { "value": 1.75 }, + + "adhesion_type": { "value": "skirt" }, + "cool_fan_full_at_height": { "value": "layer_height_0 + 2 * layer_height" }, + "cool_min_layer_time": { "value": 10 }, + "z_seam_type": { "value": "back" }, + "travel_retract_before_outer_wall": { "value": true }, + "optimize_wall_printing_order": { "value": true }, + "top_bottom_thickness": { "value": "layer_height_0 + layer_height * 3" }, + "wall_thickness": { "value": "line_width * 2" }, + + "speed_print": { "value": 50 }, + "speed_layer_0": { "value": 20.0 }, + + "machine_start_gcode": { "default_value": "G21 ; set units to millimeters\nG90 ; use absolute positioning\nM82 ; absolute extrusion mode\nG28 ; home axes\nM104 S{material_print_temperature_layer_0} ; set extruder temp\nM140 S{material_bed_temperature_layer_0} ; set bed temp\nM190 S{material_bed_temperature_layer_0} ; wait for bed temp\nM109 S{material_print_temperature_layer_0} ; wait for extruder temp\nG29 ; mesh bed leveling\n\nG92 E0\nG1 X5 Y5 Z0.8 F1800\nG1 X100 Z0.3 E25 F900\nG92 E0\nG1 E-2 F2400"}, + "machine_end_gcode": { "default_value": "M104 S0 ; turn off extruder\nM140 S0 ; turn off heatbed\nM107 ; turn off fan\nG1 X0 Y{machine_depth}; home X axis and push Y forward\nG28 Z0\nM84 ; disable motors" } + + } +} \ No newline at end of file From d748e609f9ac3a20ac8eb0168f6ccfc3b6e8ccc1 Mon Sep 17 00:00:00 2001 From: Randy Zwitch Date: Sat, 15 Jul 2023 13:08:08 -0400 Subject: [PATCH 02/34] Add E444M extruder file --- .../extruders/matterhackers_extruder.def.json | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 resources/extruders/matterhackers_extruder.def.json diff --git a/resources/extruders/matterhackers_extruder.def.json b/resources/extruders/matterhackers_extruder.def.json new file mode 100644 index 0000000000..f05e4b4e20 --- /dev/null +++ b/resources/extruders/matterhackers_extruder.def.json @@ -0,0 +1,16 @@ +{ + "version": 2, + "name": "Extruder 1", + "inherits": "fdmextruder", + "metadata": + { + "machine": "matterhackers_pulsexe_e444m", + "position": "0" + }, + "overrides": + { + "extruder_nr": { "default_value": 0 }, + "machine_nozzle_size": { "default_value": 0.4 }, + "material_diameter": { "default_value": 1.75 } + } +} \ No newline at end of file From d1f8125f51882adb9bfe4702f2bd97e8f9dfbc6d Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Tue, 8 Aug 2023 17:19:35 +0200 Subject: [PATCH 03/34] Add setting to prevent the top layer from doing small-skin behaviour. Actually the other way around, so we don't have another negation you have to turn on to turn off (and so the default can be false I suppose). The idea is that recently, a feature was introduced where there should be walls instead of normal skin in small hard to reach places of the model. However, this is to be excluded in most cases for all the top-layer parts exposed to air on the buildplate. implements CURA-10829 --- resources/definitions/fdmprinter.def.json | 13 ++++++++++++- resources/setting_visibility/advanced.cfg | 2 ++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index b1e82c0b65..5ba9e87450 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -1664,7 +1664,7 @@ "small_skin_width": { "label": "Small Top/Bottom Width", - "description": "Small top/bottom regions are filled with walls instead of the default top/bottom pattern. This helps to avoids jerky motions.", + "description": "Small top/bottom regions are filled with walls instead of the default top/bottom pattern. This helps to avoids jerky motions. Off for the topmost (air-exposed) layer by default (see 'Small Top/Bottom On Surface').", "value": "skin_line_width * 2", "default_value": 1, "minimum_value": "0", @@ -1675,6 +1675,17 @@ "settable_per_mesh": true, "unit": "mm" }, + "small_skin_on_surface": + { + "label": "Small Top/Bottom On Surface", + "description": "Enable small (up to 'Small Top/Bottom Width') regions on the topmost skinned layer (exposed to air) to be filled with walls instead of the default pattern.", + "value": "False", + "default_value": false, + "type": "bool", + "enabled": "small_skin_width > 0 and top_layers > 0", + "limit_to_extruder": "top_bottom_extruder_nr", + "settable_per_mesh": true + }, "skin_no_small_gaps_heuristic": { "label": "No Skin in Z Gaps", diff --git a/resources/setting_visibility/advanced.cfg b/resources/setting_visibility/advanced.cfg index a744c8eae8..c3451d2c98 100644 --- a/resources/setting_visibility/advanced.cfg +++ b/resources/setting_visibility/advanced.cfg @@ -34,6 +34,8 @@ bottom_thickness bottom_layers ironing_enabled skin_monotonic +small_skin_width +small_skin_on_surface [infill] infill_extruder_nr From 652fff8571ba8cd9615732f56e19e04f7ba30ff2 Mon Sep 17 00:00:00 2001 From: Remco Burema Date: Tue, 8 Aug 2023 17:33:17 +0200 Subject: [PATCH 04/34] Also add new setting to expert. part of CURA-10829 --- resources/setting_visibility/expert.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/resources/setting_visibility/expert.cfg b/resources/setting_visibility/expert.cfg index 6517728968..cab4bb7d8f 100644 --- a/resources/setting_visibility/expert.cfg +++ b/resources/setting_visibility/expert.cfg @@ -60,6 +60,7 @@ skin_monotonic connect_skin_polygons skin_angles small_skin_width +small_skin_on_surface skin_no_small_gaps_heuristic skin_outline_count ironing_enabled From 874f4a1b4a2d18ea5db250e4d66dd84906a8d9c0 Mon Sep 17 00:00:00 2001 From: Maksym Shevchenko Date: Fri, 18 Aug 2023 10:37:13 +0300 Subject: [PATCH 05/34] Update kingroon_kp3s_pro.def.json Added the default machine_depth value. Changed the default machine_name value. --- resources/definitions/kingroon_kp3s_pro.def.json | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/resources/definitions/kingroon_kp3s_pro.def.json b/resources/definitions/kingroon_kp3s_pro.def.json index 79a4916680..e06ce0b891 100644 --- a/resources/definitions/kingroon_kp3s_pro.def.json +++ b/resources/definitions/kingroon_kp3s_pro.def.json @@ -13,6 +13,8 @@ { "machine_acceleration": { "value": 1000 }, "machine_height": { "default_value": 200 }, + "machine_width": { "default_value": 200 }, + "machine_depth": { "default_value": 200 }, "machine_max_acceleration_e": { "value": 1000 }, "machine_max_acceleration_x": { "value": 1000 }, "machine_max_acceleration_y": { "value": 1000 }, @@ -23,12 +25,11 @@ "machine_max_feedrate_z": { "value": 4 }, "machine_max_jerk_xy": { "value": 15 }, "machine_max_jerk_z": { "value": 0.4 }, - "machine_name": { "default_value": "Kingroon KP3S" }, + "machine_name": { "default_value": "Kingroon KP3S Pro" }, "machine_steps_per_mm_e": { "value": 764 }, "machine_steps_per_mm_x": { "value": 160 }, "machine_steps_per_mm_y": { "value": 160 }, "machine_steps_per_mm_z": { "value": 800 }, - "machine_width": { "default_value": 200 }, "retraction_amount": { "value": 1 }, "retraction_extrusion_window": { "value": 1 }, "retraction_speed": { "value": 40 }, From 9b140a7e67ed5fe4f7d4ee2bb2264c7e80c80204 Mon Sep 17 00:00:00 2001 From: Maksym Shevchenko Date: Fri, 18 Aug 2023 10:40:01 +0300 Subject: [PATCH 06/34] Added missing extruder variants Added missing extruder variants for Kingroon KP3S Pro. --- .../kingroon/kingroon_kp3s_pro_0.2.inst.cfg | 13 +++++++++++++ .../kingroon/kingroon_kp3s_pro_0.3.inst.cfg | 13 +++++++++++++ .../kingroon/kingroon_kp3s_pro_0.4.inst.cfg | 13 +++++++++++++ .../kingroon/kingroon_kp3s_pro_0.5.inst.cfg | 13 +++++++++++++ .../kingroon/kingroon_kp3s_pro_0.6.inst.cfg | 13 +++++++++++++ .../kingroon/kingroon_kp3s_pro_0.8.inst.cfg | 13 +++++++++++++ .../kingroon/kingroon_kp3s_pro_1.0.inst.cfg | 13 +++++++++++++ 7 files changed, 91 insertions(+) create mode 100644 resources/variants/kingroon/kingroon_kp3s_pro_0.2.inst.cfg create mode 100644 resources/variants/kingroon/kingroon_kp3s_pro_0.3.inst.cfg create mode 100644 resources/variants/kingroon/kingroon_kp3s_pro_0.4.inst.cfg create mode 100644 resources/variants/kingroon/kingroon_kp3s_pro_0.5.inst.cfg create mode 100644 resources/variants/kingroon/kingroon_kp3s_pro_0.6.inst.cfg create mode 100644 resources/variants/kingroon/kingroon_kp3s_pro_0.8.inst.cfg create mode 100644 resources/variants/kingroon/kingroon_kp3s_pro_1.0.inst.cfg diff --git a/resources/variants/kingroon/kingroon_kp3s_pro_0.2.inst.cfg b/resources/variants/kingroon/kingroon_kp3s_pro_0.2.inst.cfg new file mode 100644 index 0000000000..4d0858a573 --- /dev/null +++ b/resources/variants/kingroon/kingroon_kp3s_pro_0.2.inst.cfg @@ -0,0 +1,13 @@ +[general] +definition = kingroon_kp3s_pro +name = 0.2mm Nozzle +version = 4 + +[metadata] +hardware_type = nozzle +setting_version = 22 +type = variant + +[values] +machine_nozzle_size = 0.2 + diff --git a/resources/variants/kingroon/kingroon_kp3s_pro_0.3.inst.cfg b/resources/variants/kingroon/kingroon_kp3s_pro_0.3.inst.cfg new file mode 100644 index 0000000000..e127a63c76 --- /dev/null +++ b/resources/variants/kingroon/kingroon_kp3s_pro_0.3.inst.cfg @@ -0,0 +1,13 @@ +[general] +definition = kingroon_kp3s_pro +name = 0.3mm Nozzle +version = 4 + +[metadata] +hardware_type = nozzle +setting_version = 22 +type = variant + +[values] +machine_nozzle_size = 0.3 + diff --git a/resources/variants/kingroon/kingroon_kp3s_pro_0.4.inst.cfg b/resources/variants/kingroon/kingroon_kp3s_pro_0.4.inst.cfg new file mode 100644 index 0000000000..3422da8b90 --- /dev/null +++ b/resources/variants/kingroon/kingroon_kp3s_pro_0.4.inst.cfg @@ -0,0 +1,13 @@ +[general] +definition = kingroon_kp3s_pro +name = 0.4mm Nozzle +version = 4 + +[metadata] +hardware_type = nozzle +setting_version = 22 +type = variant + +[values] +machine_nozzle_size = 0.4 + diff --git a/resources/variants/kingroon/kingroon_kp3s_pro_0.5.inst.cfg b/resources/variants/kingroon/kingroon_kp3s_pro_0.5.inst.cfg new file mode 100644 index 0000000000..744e7e441d --- /dev/null +++ b/resources/variants/kingroon/kingroon_kp3s_pro_0.5.inst.cfg @@ -0,0 +1,13 @@ +[general] +definition = kingroon_kp3s_pro +name = 0.5mm Nozzle +version = 4 + +[metadata] +hardware_type = nozzle +setting_version = 22 +type = variant + +[values] +machine_nozzle_size = 0.5 + diff --git a/resources/variants/kingroon/kingroon_kp3s_pro_0.6.inst.cfg b/resources/variants/kingroon/kingroon_kp3s_pro_0.6.inst.cfg new file mode 100644 index 0000000000..289eb3bd96 --- /dev/null +++ b/resources/variants/kingroon/kingroon_kp3s_pro_0.6.inst.cfg @@ -0,0 +1,13 @@ +[general] +definition = kingroon_kp3s_pro +name = 0.6mm Nozzle +version = 4 + +[metadata] +hardware_type = nozzle +setting_version = 22 +type = variant + +[values] +machine_nozzle_size = 0.6 + diff --git a/resources/variants/kingroon/kingroon_kp3s_pro_0.8.inst.cfg b/resources/variants/kingroon/kingroon_kp3s_pro_0.8.inst.cfg new file mode 100644 index 0000000000..68aa6dc7da --- /dev/null +++ b/resources/variants/kingroon/kingroon_kp3s_pro_0.8.inst.cfg @@ -0,0 +1,13 @@ +[general] +definition = kingroon_kp3s_pro +name = 0.8mm Nozzle +version = 4 + +[metadata] +hardware_type = nozzle +setting_version = 22 +type = variant + +[values] +machine_nozzle_size = 0.8 + diff --git a/resources/variants/kingroon/kingroon_kp3s_pro_1.0.inst.cfg b/resources/variants/kingroon/kingroon_kp3s_pro_1.0.inst.cfg new file mode 100644 index 0000000000..5e332ea26b --- /dev/null +++ b/resources/variants/kingroon/kingroon_kp3s_pro_1.0.inst.cfg @@ -0,0 +1,13 @@ +[general] +definition = kingroon_kp3s_pro +name = 1.0mm Nozzle +version = 4 + +[metadata] +hardware_type = nozzle +setting_version = 22 +type = variant + +[values] +machine_nozzle_size = 1.0 + From a3d664571a847c510bf2557614b12a5782d1697b Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Fri, 18 Aug 2023 14:45:02 +0200 Subject: [PATCH 07/34] Add scrollable area around text messages CURA-9374 --- .../resources/qml/LicenseDialog.qml | 4 +- .../resources/qml/MultipleLicenseDialog.qml | 4 +- plugins/SliceInfoPlugin/MoreInfoWindow.qml | 4 +- .../qml/WelcomePages/ChangelogContent.qml | 4 +- .../qml/WelcomePages/WhatsNewContent.qml | 4 +- resources/qml/Widgets/ScrollableTextArea.qml | 44 ------------------- 6 files changed, 10 insertions(+), 54 deletions(-) delete mode 100644 resources/qml/Widgets/ScrollableTextArea.qml diff --git a/plugins/Marketplace/resources/qml/LicenseDialog.qml b/plugins/Marketplace/resources/qml/LicenseDialog.qml index 5dd8ac6fc4..849df5925e 100644 --- a/plugins/Marketplace/resources/qml/LicenseDialog.qml +++ b/plugins/Marketplace/resources/qml/LicenseDialog.qml @@ -6,7 +6,7 @@ import QtQuick.Window 2.2 import QtQuick.Controls 2.3 import QtQuick.Layouts 1.3 -import UM 1.6 as UM +import UM 1.7 as UM import Cura 1.6 as Cura UM.Dialog @@ -52,7 +52,7 @@ UM.Dialog } } - Cura.ScrollableTextArea + UM.ScrollableTextArea { Layout.fillWidth: true Layout.fillHeight: true diff --git a/plugins/Marketplace/resources/qml/MultipleLicenseDialog.qml b/plugins/Marketplace/resources/qml/MultipleLicenseDialog.qml index a3d4b60221..c92709e954 100644 --- a/plugins/Marketplace/resources/qml/MultipleLicenseDialog.qml +++ b/plugins/Marketplace/resources/qml/MultipleLicenseDialog.qml @@ -6,7 +6,7 @@ import QtQuick.Window 2.2 import QtQuick.Controls 2.3 import QtQuick.Layouts 1.3 -import UM 1.5 as UM +import UM 1.7 as UM import Cura 1.6 as Cura UM.Dialog @@ -66,7 +66,7 @@ UM.Dialog } } - Cura.ScrollableTextArea + UM.ScrollableTextArea { Layout.fillWidth: true Layout.fillHeight: true diff --git a/plugins/SliceInfoPlugin/MoreInfoWindow.qml b/plugins/SliceInfoPlugin/MoreInfoWindow.qml index e0954dc55e..3debd8e707 100644 --- a/plugins/SliceInfoPlugin/MoreInfoWindow.qml +++ b/plugins/SliceInfoPlugin/MoreInfoWindow.qml @@ -5,7 +5,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 import QtQuick.Window 2.2 -import UM 1.5 as UM +import UM 1.7 as UM import Cura 1.1 as Cura Window @@ -74,7 +74,7 @@ Window wrapMode: Text.WordWrap } - Cura.ScrollableTextArea + UM.ScrollableTextArea { anchors { diff --git a/resources/qml/WelcomePages/ChangelogContent.qml b/resources/qml/WelcomePages/ChangelogContent.qml index 7c3b1adfc3..20380f3938 100644 --- a/resources/qml/WelcomePages/ChangelogContent.qml +++ b/resources/qml/WelcomePages/ChangelogContent.qml @@ -4,7 +4,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import UM 1.5 as UM +import UM 1.7 as UM import Cura 1.1 as Cura @@ -26,7 +26,7 @@ Item font: UM.Theme.getFont("huge") } - Cura.ScrollableTextArea + UM.ScrollableTextArea { id: changelogTextArea diff --git a/resources/qml/WelcomePages/WhatsNewContent.qml b/resources/qml/WelcomePages/WhatsNewContent.qml index 6406d65756..eefadbdacf 100644 --- a/resources/qml/WelcomePages/WhatsNewContent.qml +++ b/resources/qml/WelcomePages/WhatsNewContent.qml @@ -5,7 +5,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 import QtQuick.Layouts 1.3 -import UM 1.5 as UM +import UM 1.7 as UM import Cura 1.1 as Cura @@ -90,7 +90,7 @@ Item source: manager.getSubpageImageSource(index) } - Cura.ScrollableTextArea + UM.ScrollableTextArea { id: subpageText diff --git a/resources/qml/Widgets/ScrollableTextArea.qml b/resources/qml/Widgets/ScrollableTextArea.qml deleted file mode 100644 index 7d8f6b886d..0000000000 --- a/resources/qml/Widgets/ScrollableTextArea.qml +++ /dev/null @@ -1,44 +0,0 @@ -// Copyright (c) 2022 Ultimaker B.V. -// Cura is released under the terms of the LGPLv3 or higher. - -import QtQuick 2.10 -import QtQuick.Controls 2.3 - -import UM 1.5 as UM -import Cura 1.1 as Cura - - -// -// Cura-style TextArea with scrolls -// -Flickable -{ - id: scrollableTextAreaBase - property bool do_borders: true - property var back_color: UM.Theme.getColor("main_background") - property alias textArea: flickableTextArea - - ScrollBar.vertical: UM.ScrollBar {} - - TextArea.flickable: TextArea - { - id: flickableTextArea - - background: Rectangle //Providing the background color and border. - { - anchors.fill: parent - anchors.margins: -border.width - - color: scrollableTextAreaBase.back_color - border.color: UM.Theme.getColor("thick_lining") - border.width: scrollableTextAreaBase.do_borders ? UM.Theme.getSize("default_lining").width : 0 - } - - font: UM.Theme.getFont("default") - color: UM.Theme.getColor("text") - textFormat: TextEdit.PlainText - renderType: Text.NativeRendering - wrapMode: Text.Wrap - selectByMouse: true - } -} \ No newline at end of file From 4f6c0001b61bd6af8f029c760d7290cc001a9cb3 Mon Sep 17 00:00:00 2001 From: "saumya.jain" Date: Fri, 18 Aug 2023 14:55:19 +0200 Subject: [PATCH 08/34] Sponsor cura added at designated loc CURA-10832 --- resources/qml/Actions.qml | 8 ++++++++ .../qml/ApplicationSwitcher/ApplicationSwitcherPopup.qml | 8 ++++---- resources/qml/Menus/HelpMenu.qml | 1 + resources/themes/cura-light/icons/default/Heart.svg | 7 +++++++ 4 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 resources/themes/cura-light/icons/default/Heart.svg diff --git a/resources/qml/Actions.qml b/resources/qml/Actions.qml index 3b75c7699e..d9d35946ea 100644 --- a/resources/qml/Actions.qml +++ b/resources/qml/Actions.qml @@ -60,6 +60,7 @@ Item property alias showProfileFolder: showProfileFolderAction property alias documentation: documentationAction property alias showTroubleshooting: showTroubleShootingAction + property alias openSponsershipPage : openSponsershipPageAction property alias reportBug: reportBugAction property alias whatsNew: whatsNewAction property alias about: aboutAction @@ -90,6 +91,13 @@ Item text: catalog.i18nc("@action:inmenu", "Show Online Troubleshooting") } + Action + { + id: openSponsershipPageAction + onTriggered: Qt.openUrlExternally("https://ultimaker.com/software/ultimaker-cura/sponsor/") + text: catalog.i18nc("@action:inmenu", "Sponsor Cura") + } + Action { id: toggleFullScreenAction diff --git a/resources/qml/ApplicationSwitcher/ApplicationSwitcherPopup.qml b/resources/qml/ApplicationSwitcher/ApplicationSwitcherPopup.qml index f13ca28447..252329bf16 100644 --- a/resources/qml/ApplicationSwitcher/ApplicationSwitcherPopup.qml +++ b/resources/qml/ApplicationSwitcher/ApplicationSwitcherPopup.qml @@ -57,10 +57,10 @@ Popup permissionsRequired: [] }, { - displayName: "UltiMaker Academy", //Not translated, since it's a brand name. - thumbnail: UM.Theme.getIcon("Knowledge"), - description: catalog.i18nc("@tooltip:button", "Become a 3D printing expert with UltiMaker e-learning."), - link: "https://academy.ultimaker.com/?utm_source=cura&utm_medium=software&utm_campaign=switcher-academy", + displayName: "Sponsor Cura", //Not translated, since it's a brand name. + thumbnail: UM.Theme.getIcon("Heart"), + description: catalog.i18nc("@tooltip:button", "Show your support for Cura with a donation."), + link: "https://ultimaker.com/software/ultimaker-cura/sponsor/", permissionsRequired: [] }, { diff --git a/resources/qml/Menus/HelpMenu.qml b/resources/qml/Menus/HelpMenu.qml index 4be25fdffe..6a57a99515 100644 --- a/resources/qml/Menus/HelpMenu.qml +++ b/resources/qml/Menus/HelpMenu.qml @@ -17,6 +17,7 @@ Cura.Menu Cura.MenuItem { action: Cura.Actions.showTroubleshooting} Cura.MenuItem { action: Cura.Actions.documentation } Cura.MenuItem { action: Cura.Actions.reportBug } + Cura.MenuItem { action: Cura.Actions.openSponsershipPage } Cura.MenuSeparator { } Cura.MenuItem { action: Cura.Actions.whatsNew } Cura.MenuItem { action: Cura.Actions.about } diff --git a/resources/themes/cura-light/icons/default/Heart.svg b/resources/themes/cura-light/icons/default/Heart.svg new file mode 100644 index 0000000000..793dcbd6b5 --- /dev/null +++ b/resources/themes/cura-light/icons/default/Heart.svg @@ -0,0 +1,7 @@ + + + + + + + From 3e63863a72eb3d192b9d80965593b4f3bb7612de Mon Sep 17 00:00:00 2001 From: Casper Lamboo Date: Fri, 18 Aug 2023 16:41:38 +0200 Subject: [PATCH 09/34] Formatting --- resources/qml/Actions.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/Actions.qml b/resources/qml/Actions.qml index d9d35946ea..f945b1c11d 100644 --- a/resources/qml/Actions.qml +++ b/resources/qml/Actions.qml @@ -60,7 +60,7 @@ Item property alias showProfileFolder: showProfileFolderAction property alias documentation: documentationAction property alias showTroubleshooting: showTroubleShootingAction - property alias openSponsershipPage : openSponsershipPageAction + property alias openSponsershipPage: openSponsershipPageAction property alias reportBug: reportBugAction property alias whatsNew: whatsNewAction property alias about: aboutAction From 62a32fc725ace9d06488828b68fb39f831d34b6e Mon Sep 17 00:00:00 2001 From: Saumya Jain <70144862+saumyaj3@users.noreply.github.com> Date: Fri, 18 Aug 2023 17:34:54 +0200 Subject: [PATCH 10/34] Update resources/qml/ApplicationSwitcher/ApplicationSwitcherPopup.qml translating sponser cura Co-authored-by: Casper Lamboo --- resources/qml/ApplicationSwitcher/ApplicationSwitcherPopup.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/qml/ApplicationSwitcher/ApplicationSwitcherPopup.qml b/resources/qml/ApplicationSwitcher/ApplicationSwitcherPopup.qml index 252329bf16..a42239056c 100644 --- a/resources/qml/ApplicationSwitcher/ApplicationSwitcherPopup.qml +++ b/resources/qml/ApplicationSwitcher/ApplicationSwitcherPopup.qml @@ -57,7 +57,7 @@ Popup permissionsRequired: [] }, { - displayName: "Sponsor Cura", //Not translated, since it's a brand name. + displayName: catalog.i18nc("@label:button", "Sponsor Cura"), thumbnail: UM.Theme.getIcon("Heart"), description: catalog.i18nc("@tooltip:button", "Show your support for Cura with a donation."), link: "https://ultimaker.com/software/ultimaker-cura/sponsor/", From 6870a3bce48f5115f390c1e93b41b3e9f87b721a Mon Sep 17 00:00:00 2001 From: "saumya.jain" Date: Mon, 21 Aug 2023 10:06:51 +0200 Subject: [PATCH 11/34] improve number of iterations CURA-10685 --- cura/Settings/CuraFormulaFunctions.py | 8 ++++---- resources/definitions/fdmprinter.def.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cura/Settings/CuraFormulaFunctions.py b/cura/Settings/CuraFormulaFunctions.py index fd6555e679..8dd96cc03e 100644 --- a/cura/Settings/CuraFormulaFunctions.py +++ b/cura/Settings/CuraFormulaFunctions.py @@ -101,10 +101,10 @@ class CuraFormulaFunctions: def getAnyExtruderPositionWithOrDefault(self, filter_key: str, context: Optional["PropertyEvaluationContext"] = None) -> str: for extruder in self._getActiveExtruders(context): - value = extruder.getRawProperty(filter_key, "value", context=context) - if value is None or not value: - continue - return str(extruder.position) + material_container = extruder.material + value = material_container.getProperty(filter_key, "value", context) + if value is not None: + return extruder.position return self.getDefaultExtruderPosition() # Get the resolve value or value for a given key. diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 9c83431f54..525a5e1eee 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -4488,7 +4488,7 @@ "type": "extruder", "default_value": "0", "enabled": "(support_enable or support_meshes_present) and extruders_enabled_count > 1", - "value": "int(defaultExtruderPosition())", + "value": "int(anyExtruderNrWithOrDefault('material_is_support_material'))", "settable_per_mesh": false, "settable_per_extruder": false, "children": From 0c405288e010ac341f4ce9965d0f9dd4ebe79535 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Mon, 21 Aug 2023 15:50:52 +0200 Subject: [PATCH 12/34] Add wrapper to Cura.ScrollableTextArea Add wrapper to legacy Cura.ScrollableTextArea class which has now moved to Uranium, in order to keep plugins working in case they use it. CURA-9374 --- .../Marketplace/resources/qml/LicenseDialog.qml | 2 +- .../resources/qml/MultipleLicenseDialog.qml | 2 +- plugins/SliceInfoPlugin/MoreInfoWindow.qml | 2 +- resources/qml/WelcomePages/ChangelogContent.qml | 2 +- resources/qml/WelcomePages/WhatsNewContent.qml | 2 +- resources/qml/Widgets/ScrollableTextArea.qml | 14 ++++++++++++++ 6 files changed, 19 insertions(+), 5 deletions(-) create mode 100644 resources/qml/Widgets/ScrollableTextArea.qml diff --git a/plugins/Marketplace/resources/qml/LicenseDialog.qml b/plugins/Marketplace/resources/qml/LicenseDialog.qml index 849df5925e..775e53f7aa 100644 --- a/plugins/Marketplace/resources/qml/LicenseDialog.qml +++ b/plugins/Marketplace/resources/qml/LicenseDialog.qml @@ -52,7 +52,7 @@ UM.Dialog } } - UM.ScrollableTextArea + Cura.ScrollableTextArea { Layout.fillWidth: true Layout.fillHeight: true diff --git a/plugins/Marketplace/resources/qml/MultipleLicenseDialog.qml b/plugins/Marketplace/resources/qml/MultipleLicenseDialog.qml index c92709e954..b251aeab85 100644 --- a/plugins/Marketplace/resources/qml/MultipleLicenseDialog.qml +++ b/plugins/Marketplace/resources/qml/MultipleLicenseDialog.qml @@ -66,7 +66,7 @@ UM.Dialog } } - UM.ScrollableTextArea + Cura.ScrollableTextArea { Layout.fillWidth: true Layout.fillHeight: true diff --git a/plugins/SliceInfoPlugin/MoreInfoWindow.qml b/plugins/SliceInfoPlugin/MoreInfoWindow.qml index 3debd8e707..76b9e651c7 100644 --- a/plugins/SliceInfoPlugin/MoreInfoWindow.qml +++ b/plugins/SliceInfoPlugin/MoreInfoWindow.qml @@ -74,7 +74,7 @@ Window wrapMode: Text.WordWrap } - UM.ScrollableTextArea + Cura.ScrollableTextArea { anchors { diff --git a/resources/qml/WelcomePages/ChangelogContent.qml b/resources/qml/WelcomePages/ChangelogContent.qml index 20380f3938..9be3c30373 100644 --- a/resources/qml/WelcomePages/ChangelogContent.qml +++ b/resources/qml/WelcomePages/ChangelogContent.qml @@ -26,7 +26,7 @@ Item font: UM.Theme.getFont("huge") } - UM.ScrollableTextArea + Cura.ScrollableTextArea { id: changelogTextArea diff --git a/resources/qml/WelcomePages/WhatsNewContent.qml b/resources/qml/WelcomePages/WhatsNewContent.qml index eefadbdacf..787b280095 100644 --- a/resources/qml/WelcomePages/WhatsNewContent.qml +++ b/resources/qml/WelcomePages/WhatsNewContent.qml @@ -90,7 +90,7 @@ Item source: manager.getSubpageImageSource(index) } - UM.ScrollableTextArea + Cura.ScrollableTextArea { id: subpageText diff --git a/resources/qml/Widgets/ScrollableTextArea.qml b/resources/qml/Widgets/ScrollableTextArea.qml new file mode 100644 index 0000000000..3f0db28058 --- /dev/null +++ b/resources/qml/Widgets/ScrollableTextArea.qml @@ -0,0 +1,14 @@ +// Copyright (c) 2022 Ultimaker B.V. +// Cura is released under the terms of the LGPLv3 or higher. + +import QtQuick 2.10 +import QtQuick.Controls 2.3 + +import UM 1.7 as UM +import Cura 1.1 as Cura + + +// Wrapper to UM.ScrollableTextArea which was originally placed here +UM.ScrollableTextArea +{ +} From 89cb69a376faf93b880d88a33f833cc7dbb4a8c2 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Mon, 21 Aug 2023 15:57:36 +0200 Subject: [PATCH 13/34] Restored QML import versions Restore versions to minimize the impact of CURA-9374 --- plugins/Marketplace/resources/qml/LicenseDialog.qml | 2 +- plugins/Marketplace/resources/qml/MultipleLicenseDialog.qml | 2 +- plugins/SliceInfoPlugin/MoreInfoWindow.qml | 2 +- resources/qml/WelcomePages/ChangelogContent.qml | 2 +- resources/qml/WelcomePages/WhatsNewContent.qml | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/Marketplace/resources/qml/LicenseDialog.qml b/plugins/Marketplace/resources/qml/LicenseDialog.qml index 775e53f7aa..5dd8ac6fc4 100644 --- a/plugins/Marketplace/resources/qml/LicenseDialog.qml +++ b/plugins/Marketplace/resources/qml/LicenseDialog.qml @@ -6,7 +6,7 @@ import QtQuick.Window 2.2 import QtQuick.Controls 2.3 import QtQuick.Layouts 1.3 -import UM 1.7 as UM +import UM 1.6 as UM import Cura 1.6 as Cura UM.Dialog diff --git a/plugins/Marketplace/resources/qml/MultipleLicenseDialog.qml b/plugins/Marketplace/resources/qml/MultipleLicenseDialog.qml index b251aeab85..a3d4b60221 100644 --- a/plugins/Marketplace/resources/qml/MultipleLicenseDialog.qml +++ b/plugins/Marketplace/resources/qml/MultipleLicenseDialog.qml @@ -6,7 +6,7 @@ import QtQuick.Window 2.2 import QtQuick.Controls 2.3 import QtQuick.Layouts 1.3 -import UM 1.7 as UM +import UM 1.5 as UM import Cura 1.6 as Cura UM.Dialog diff --git a/plugins/SliceInfoPlugin/MoreInfoWindow.qml b/plugins/SliceInfoPlugin/MoreInfoWindow.qml index 76b9e651c7..e0954dc55e 100644 --- a/plugins/SliceInfoPlugin/MoreInfoWindow.qml +++ b/plugins/SliceInfoPlugin/MoreInfoWindow.qml @@ -5,7 +5,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 import QtQuick.Window 2.2 -import UM 1.7 as UM +import UM 1.5 as UM import Cura 1.1 as Cura Window diff --git a/resources/qml/WelcomePages/ChangelogContent.qml b/resources/qml/WelcomePages/ChangelogContent.qml index 9be3c30373..7c3b1adfc3 100644 --- a/resources/qml/WelcomePages/ChangelogContent.qml +++ b/resources/qml/WelcomePages/ChangelogContent.qml @@ -4,7 +4,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 -import UM 1.7 as UM +import UM 1.5 as UM import Cura 1.1 as Cura diff --git a/resources/qml/WelcomePages/WhatsNewContent.qml b/resources/qml/WelcomePages/WhatsNewContent.qml index 787b280095..6406d65756 100644 --- a/resources/qml/WelcomePages/WhatsNewContent.qml +++ b/resources/qml/WelcomePages/WhatsNewContent.qml @@ -5,7 +5,7 @@ import QtQuick 2.10 import QtQuick.Controls 2.3 import QtQuick.Layouts 1.3 -import UM 1.7 as UM +import UM 1.5 as UM import Cura 1.1 as Cura From ac8a958decf3c4539a91a7d71214d79226591823 Mon Sep 17 00:00:00 2001 From: rburema Date: Tue, 22 Aug 2023 08:15:02 +0000 Subject: [PATCH 14/34] Applied printer-linter format --- resources/definitions/fdmprinter.def.json | 1 - 1 file changed, 1 deletion(-) diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 9a83817726..ccd92c9ba3 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -1664,7 +1664,6 @@ "small_skin_width": { "label": "Small Top/Bottom Width", - "description": "Small top/bottom regions are filled with walls instead of the default top/bottom pattern. This helps to avoids jerky motions. Off for the topmost (air-exposed) layer by default (see 'Small Top/Bottom On Surface').", "value": "skin_line_width * 2", "default_value": 1, From 5dc417cf0aab9ebae5116606474262c3f502109d Mon Sep 17 00:00:00 2001 From: saumyaj3 Date: Tue, 22 Aug 2023 11:59:03 +0000 Subject: [PATCH 15/34] Applied printer-linter format --- resources/definitions/kingroon_kp3s_pro.def.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/resources/definitions/kingroon_kp3s_pro.def.json b/resources/definitions/kingroon_kp3s_pro.def.json index e06ce0b891..bda5ac03b2 100644 --- a/resources/definitions/kingroon_kp3s_pro.def.json +++ b/resources/definitions/kingroon_kp3s_pro.def.json @@ -5,16 +5,15 @@ "metadata": { "visible": true, + "author": "willuhmjs", "platform": "kingroon_kp3s.stl", - "quality_definition": "kingroon_base", - "author": "willuhmjs" + "quality_definition": "kingroon_base" }, "overrides": { "machine_acceleration": { "value": 1000 }, - "machine_height": { "default_value": 200 }, - "machine_width": { "default_value": 200 }, "machine_depth": { "default_value": 200 }, + "machine_height": { "default_value": 200 }, "machine_max_acceleration_e": { "value": 1000 }, "machine_max_acceleration_x": { "value": 1000 }, "machine_max_acceleration_y": { "value": 1000 }, @@ -30,9 +29,10 @@ "machine_steps_per_mm_x": { "value": 160 }, "machine_steps_per_mm_y": { "value": 160 }, "machine_steps_per_mm_z": { "value": 800 }, + "machine_width": { "default_value": 200 }, "retraction_amount": { "value": 1 }, "retraction_extrusion_window": { "value": 1 }, "retraction_speed": { "value": 40 }, "speed_z_hop": { "value": 4 } } -} +} \ No newline at end of file From 1f6c096bf719b508b6e0234ad33ac687771aa7f8 Mon Sep 17 00:00:00 2001 From: "c.lamboo" Date: Tue, 22 Aug 2023 16:42:34 +0200 Subject: [PATCH 16/34] Don't omit printers in printer list Since the message is now scrollable we can do this :) --- .../src/Messages/NewPrinterDetectedMessage.py | 21 +++++-------------- 1 file changed, 5 insertions(+), 16 deletions(-) diff --git a/plugins/UM3NetworkPrinting/src/Messages/NewPrinterDetectedMessage.py b/plugins/UM3NetworkPrinting/src/Messages/NewPrinterDetectedMessage.py index d85ade9dce..76254547da 100644 --- a/plugins/UM3NetworkPrinting/src/Messages/NewPrinterDetectedMessage.py +++ b/plugins/UM3NetworkPrinting/src/Messages/NewPrinterDetectedMessage.py @@ -37,24 +37,13 @@ class NewPrinterDetectedMessage(Message): def finalize(self, new_devices_added, new_output_devices): self.setProgress(None) - num_devices_added = len(new_devices_added) - max_disp_devices = 3 - - if num_devices_added > max_disp_devices: - num_hidden = num_devices_added - max_disp_devices - device_name_list = ["
  • {} ({})
  • ".format(device.name, device.printerTypeName) for device in - new_output_devices[0: max_disp_devices]] - device_name_list.append( - "
  • " + self.i18n_catalog.i18ncp("info:{0} gets replaced by a number of printers", "... and {0} other", - "... and {0} others", num_hidden) + "
  • ") - device_names = "".join(device_name_list) - else: - device_names = "".join( - ["
  • {} ({})
  • ".format(device.name, device.printerTypeName) for device in new_devices_added]) if new_devices_added: - message_text = self.i18n_catalog.i18nc("info:status", - "Printers added from Digital Factory:") + f"
      {device_names}
    " + device_names = "" + for device in new_devices_added: + device_names = device_names + "
  • {} ({})
  • ".format(device.name, device.printerTypeName) + message_title = self.i18n_catalog.i18nc("info:status", "Printers added from Digital Factory:") + message_text = f"{message_title}
      {device_names}
    " self.setText(message_text) else: self.hide() From 9000730ce72ebd395ca662e37513584acb45678c Mon Sep 17 00:00:00 2001 From: Casper Lamboo Date: Wed, 23 Aug 2023 11:39:54 +0200 Subject: [PATCH 17/34] use template strings --- packaging/MacOS/build_macos.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packaging/MacOS/build_macos.py b/packaging/MacOS/build_macos.py index bde28afab0..eae9afceff 100644 --- a/packaging/MacOS/build_macos.py +++ b/packaging/MacOS/build_macos.py @@ -153,6 +153,6 @@ if __name__ == "__main__": app_name = f"{args.app_name}.app" if args.build_pkg: - create_pkg_installer(args.filename + ".pkg", args.dist_path, cura_version, app_name) + create_pkg_installer(f"{args.filename}.pkg", args.dist_path, cura_version, app_name) if args.build_dmg: - create_dmg(args.filename + ".dmg", args.dist_path, args.source_path, app_name) + create_dmg(f"{args.filename}.dmg", args.dist_path, args.source_path, app_name) From 09d4f083e0f712779d77efaca9a7ed058f0ce182 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Thu, 24 Aug 2023 11:15:34 +0200 Subject: [PATCH 18/34] Include adhesion for 1-at-a-time exclusion shadow CURA-10307 --- cura/Scene/ConvexHullDecorator.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/cura/Scene/ConvexHullDecorator.py b/cura/Scene/ConvexHullDecorator.py index 06ec247ae4..0dbf3ba782 100644 --- a/cura/Scene/ConvexHullDecorator.py +++ b/cura/Scene/ConvexHullDecorator.py @@ -111,11 +111,7 @@ class ConvexHullDecorator(SceneNodeDecorator): # Parent can be None if node is just loaded. if self._isSingularOneAtATimeNode(): - hull = self.getConvexHullHeadFull() - if hull is None: - return None - hull = self._add2DAdhesionMargin(hull) - return hull + return self.getConvexHullHeadFull() return self._compute2DConvexHull() @@ -323,6 +319,7 @@ class ConvexHullDecorator(SceneNodeDecorator): def _compute2DConvexHeadFull(self) -> Optional[Polygon]: convex_hull = self._compute2DConvexHull() + convex_hull = self._add2DAdhesionMargin(convex_hull) if convex_hull: return convex_hull.getMinkowskiHull(self._getHeadAndFans()) return None From eee1eb714b9376694f8542de5ecf3dba1ee045d5 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Thu, 24 Aug 2023 11:17:21 +0200 Subject: [PATCH 19/34] Fixed TiZYX machines head polygon definition --- resources/definitions/tizyx_evy.def.json | 2 +- resources/definitions/tizyx_evy_dual.def.json | 2 +- resources/definitions/tizyx_k25.def.json | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/resources/definitions/tizyx_evy.def.json b/resources/definitions/tizyx_evy.def.json index 41b2b982be..7ae10f5f1d 100644 --- a/resources/definitions/tizyx_evy.def.json +++ b/resources/definitions/tizyx_evy.def.json @@ -57,7 +57,7 @@ [25, 49], [25, -49], [-25, -49], - [25, 49] + [-25, 49] ] }, "machine_heated_bed": { "default_value": true }, diff --git a/resources/definitions/tizyx_evy_dual.def.json b/resources/definitions/tizyx_evy_dual.def.json index 22046a16ff..7ef3aff2ab 100644 --- a/resources/definitions/tizyx_evy_dual.def.json +++ b/resources/definitions/tizyx_evy_dual.def.json @@ -54,7 +54,7 @@ [25, 49], [25, -49], [-25, -49], - [25, 49] + [-25, 49] ] }, "machine_heated_bed": { "default_value": true }, diff --git a/resources/definitions/tizyx_k25.def.json b/resources/definitions/tizyx_k25.def.json index 60005e8712..fbae8a657d 100644 --- a/resources/definitions/tizyx_k25.def.json +++ b/resources/definitions/tizyx_k25.def.json @@ -51,7 +51,7 @@ [25, 49], [25, -49], [-25, -49], - [25, 49] + [-25, 49] ] }, "machine_heated_bed": { "default_value": true }, From 281e543255f7eeb44993ce8f2b799f681c90bde9 Mon Sep 17 00:00:00 2001 From: Erwan MATHIEU Date: Fri, 25 Aug 2023 11:27:54 +0200 Subject: [PATCH 20/34] Remove exported file after fail CURA-10180 --- .../RemovableDriveOutputDevice.py | 63 ++++++++++--------- 1 file changed, 35 insertions(+), 28 deletions(-) diff --git a/plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py b/plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py index e93473c25f..8c0c50d0b4 100644 --- a/plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py +++ b/plugins/RemovableDriveOutputDevice/RemovableDriveOutputDevice.py @@ -1,6 +1,7 @@ # Copyright (c) 2018 Ultimaker B.V. # Cura is released under the terms of the LGPLv3 or higher. +import os import os.path from UM.Application import Application @@ -143,38 +144,44 @@ class RemovableDriveOutputDevice(OutputDevice): def _onFinished(self, job): if self._stream: - # Explicitly closing the stream flushes the write-buffer + error = job.getError() try: + # Explicitly closing the stream flushes the write-buffer self._stream.close() - self._stream = None - except: - Logger.logException("w", "An exception occurred while trying to write to removable drive.") - message = Message(catalog.i18nc("@info:status", "Could not save to removable drive {0}: {1}").format(self.getName(),str(job.getError())), - title = catalog.i18nc("@info:title", "Error"), - message_type = Message.MessageType.ERROR) + except Exception as e: + if not error: + # Only log new error if there was no previous one + error = e + + self._stream = None + self._writing = False + self.writeFinished.emit(self) + + if not error: + message = Message( + catalog.i18nc("@info:status", "Saved to Removable Drive {0} as {1}").format(self.getName(), + os.path.basename( + job.getFileName())), + title=catalog.i18nc("@info:title", "File Saved"), + message_type=Message.MessageType.POSITIVE) + message.addAction("eject", catalog.i18nc("@action:button", "Eject"), "eject", + catalog.i18nc("@action", "Eject removable device {0}").format(self.getName())) + message.actionTriggered.connect(self._onActionTriggered) + message.show() + self.writeSuccess.emit(self) + else: + try: + os.remove(job.getFileName()) + except Exception as e: + Logger.logException("e", "Exception when trying to remove incomplete exported file %s", + str(job.getFileName())) + message = Message(catalog.i18nc("@info:status", + "Could not save to removable drive {0}: {1}").format(self.getName(), + str(job.getError())), + title=catalog.i18nc("@info:title", "Error"), + message_type=Message.MessageType.ERROR) message.show() self.writeError.emit(self) - return - - self._writing = False - self.writeFinished.emit(self) - if job.getResult(): - message = Message(catalog.i18nc("@info:status", "Saved to Removable Drive {0} as {1}").format(self.getName(), os.path.basename(job.getFileName())), - title = catalog.i18nc("@info:title", "File Saved"), - message_type = Message.MessageType.POSITIVE) - message.addAction("eject", catalog.i18nc("@action:button", "Eject"), "eject", catalog.i18nc("@action", "Eject removable device {0}").format(self.getName())) - message.actionTriggered.connect(self._onActionTriggered) - message.show() - self.writeSuccess.emit(self) - else: - message = Message(catalog.i18nc("@info:status", - "Could not save to removable drive {0}: {1}").format(self.getName(), - str(job.getError())), - title = catalog.i18nc("@info:title", "Error"), - message_type = Message.MessageType.ERROR) - message.show() - self.writeError.emit(self) - job.getStream().close() def _onActionTriggered(self, message, action): if action == "eject": From 9129a526ba25414570039a12efca3b699c706d43 Mon Sep 17 00:00:00 2001 From: "saumya.jain" Date: Mon, 21 Aug 2023 10:06:51 +0200 Subject: [PATCH 21/34] improve number of iterations CURA-10685 --- cura/Settings/CuraFormulaFunctions.py | 8 ++++---- resources/definitions/fdmprinter.def.json | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/cura/Settings/CuraFormulaFunctions.py b/cura/Settings/CuraFormulaFunctions.py index fd6555e679..8dd96cc03e 100644 --- a/cura/Settings/CuraFormulaFunctions.py +++ b/cura/Settings/CuraFormulaFunctions.py @@ -101,10 +101,10 @@ class CuraFormulaFunctions: def getAnyExtruderPositionWithOrDefault(self, filter_key: str, context: Optional["PropertyEvaluationContext"] = None) -> str: for extruder in self._getActiveExtruders(context): - value = extruder.getRawProperty(filter_key, "value", context=context) - if value is None or not value: - continue - return str(extruder.position) + material_container = extruder.material + value = material_container.getProperty(filter_key, "value", context) + if value is not None: + return extruder.position return self.getDefaultExtruderPosition() # Get the resolve value or value for a given key. diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index ccd92c9ba3..2f4b8cc3e2 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -4500,7 +4500,7 @@ "type": "extruder", "default_value": "0", "enabled": "(support_enable or support_meshes_present) and extruders_enabled_count > 1", - "value": "int(defaultExtruderPosition())", + "value": "int(anyExtruderNrWithOrDefault('material_is_support_material'))", "settable_per_mesh": false, "settable_per_extruder": false, "children": From ab8b7c3ab560a84a98476e1b1d04bafde096b85f Mon Sep 17 00:00:00 2001 From: "saumya.jain" Date: Fri, 25 Aug 2023 15:46:30 +0200 Subject: [PATCH 22/34] name changes CURA-10685 --- cura/CuraApplication.py | 2 +- cura/Settings/CuraFormulaFunctions.py | 6 +++--- docs/profiles/getting_a_setting_value.md | 2 +- resources/definitions/fdmprinter.def.json | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 64d88d13dc..f44393657f 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -409,7 +409,7 @@ class CuraApplication(QtApplication): SettingFunction.registerOperator("extruderValue", self._cura_formula_functions.getValueInExtruder) SettingFunction.registerOperator("extruderValues", self._cura_formula_functions.getValuesInAllExtruders) - SettingFunction.registerOperator("anyExtruderNrWithOrDefault", self._cura_formula_functions.getAnyExtruderPositionWithOrDefault) + SettingFunction.registerOperator("anyExtruderWithMaterial", self._cura_formula_functions.getExtruderPositionWithMaterial) SettingFunction.registerOperator("resolveOrValue", self._cura_formula_functions.getResolveOrValue) SettingFunction.registerOperator("defaultExtruderPosition", self._cura_formula_functions.getDefaultExtruderPosition) SettingFunction.registerOperator("valueFromContainer", self._cura_formula_functions.getValueFromContainerAtIndex) diff --git a/cura/Settings/CuraFormulaFunctions.py b/cura/Settings/CuraFormulaFunctions.py index 8dd96cc03e..08c24180bb 100644 --- a/cura/Settings/CuraFormulaFunctions.py +++ b/cura/Settings/CuraFormulaFunctions.py @@ -97,14 +97,14 @@ class CuraFormulaFunctions: return result - # Get the first extruder that adheres to a specific (boolean) property, like 'material_is_support_material'. - def getAnyExtruderPositionWithOrDefault(self, filter_key: str, + # Get the first extruder with material that adheres to a specific (boolean) property, like 'material_is_support_material'. + def getExtruderPositionWithMaterial(self, filter_key: str, context: Optional["PropertyEvaluationContext"] = None) -> str: for extruder in self._getActiveExtruders(context): material_container = extruder.material value = material_container.getProperty(filter_key, "value", context) if value is not None: - return extruder.position + return str(extruder.position) return self.getDefaultExtruderPosition() # Get the resolve value or value for a given key. diff --git a/docs/profiles/getting_a_setting_value.md b/docs/profiles/getting_a_setting_value.md index bd106eb2da..ab18be0f42 100644 --- a/docs/profiles/getting_a_setting_value.md +++ b/docs/profiles/getting_a_setting_value.md @@ -54,7 +54,7 @@ There are also a few extra things that can be used in these expressions: * The function `extruderValue(extruder, key)` will evaluate a particular setting for a particular extruder. * The function `resolveOrValue(key)` will perform the full setting evaluation as described in this document for the current context (so if this setting is being evaluated for the second extruder it would perform it as if coming from the second extruder). * The function `defaultExtruderPosition()` will get the first extruder that is not disabled. For instance, if a printer has three extruders but the first is disabled, this would return `1` to indicate the second extruder (0-indexed). -* The function `anyExtruderNrWithOrDefault(key)` will filter the list of extruders on the key, and then give the first index for which it is true, or if none of them are, the default one as specified by the 'default extruder position' function above. +* The function `anyExtruderWithMaterial(key)` will filter the list of extruders on the key of material quality, and then give the first index for which it is true, or if none of them are, the default one as specified by the 'default extruder position' function above. * The function `valueFromContainer(key, index)` will get a setting value from the global stack, but skip the first few containers in that stack. It will skip until it reaches a particular index in the container stack. * The function `extruderValueFromContainer(key, index)` will get a setting value from the current extruder stack, but skip the first few containers in that stack. It will skip until it reaches a particular index in the container stack. diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 2f4b8cc3e2..40d1eb3b1c 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -4500,7 +4500,7 @@ "type": "extruder", "default_value": "0", "enabled": "(support_enable or support_meshes_present) and extruders_enabled_count > 1", - "value": "int(anyExtruderNrWithOrDefault('material_is_support_material'))", + "value": "int(anyExtruderWithMaterial('material_is_support_material'))", "settable_per_mesh": false, "settable_per_extruder": false, "children": From 711b4401007cbbcf7455c60114a63d8ee7976049 Mon Sep 17 00:00:00 2001 From: "c.lamboo" Date: Mon, 28 Aug 2023 12:42:16 +0200 Subject: [PATCH 23/34] Update conan version CURA-10446 --- .github/workflows/requirements-conan-package.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/requirements-conan-package.txt b/.github/workflows/requirements-conan-package.txt index 26d167db2b..6b4d4cffc8 100644 --- a/.github/workflows/requirements-conan-package.txt +++ b/.github/workflows/requirements-conan-package.txt @@ -1,2 +1,2 @@ -conan==1.56.0 +conan==1.60.2 sip From 0362f8abe6af827d2af04190ed1628b2a9532879 Mon Sep 17 00:00:00 2001 From: "c.lamboo" Date: Mon, 28 Aug 2023 14:42:04 +0200 Subject: [PATCH 24/34] Revert "Update conan version" This reverts commit 711b4401007cbbcf7455c60114a63d8ee7976049. --- .github/workflows/requirements-conan-package.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/requirements-conan-package.txt b/.github/workflows/requirements-conan-package.txt index 6b4d4cffc8..26d167db2b 100644 --- a/.github/workflows/requirements-conan-package.txt +++ b/.github/workflows/requirements-conan-package.txt @@ -1,2 +1,2 @@ -conan==1.60.2 +conan==1.56.0 sip From 0e67ff38c2655b5240657500ee964811a67db3f6 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 28 Aug 2023 15:19:45 +0200 Subject: [PATCH 25/34] Update windows.yml --- .github/workflows/windows.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 88d9d84e94..df9056d454 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -124,6 +124,11 @@ jobs: - name: Create the Packages (Powershell) run: conan install $Env:CURA_CONAN_VERSION ${{ inputs.conan_args }} --build=missing --update -if cura_inst -g VirtualPythonEnv -o cura:enterprise=$Env:ENTERPRISE -o cura:staging=$Env:STAGING --json "cura_inst/conan_install_info.json" + - name: Upload the Package(s) + if: always() + run: | + conan upload "*" -r cura --all -c + - name: Set Environment variables for Cura (Powershell) run: | echo "${Env:WIX}\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append @@ -262,4 +267,4 @@ jobs: success_body: "Installers for ${{ inputs.cura_conan_version }}" failure_title: "Failed to create the Cura distributions" failure_body: "Failed to create at least 1 installer for ${{ inputs.cura_conan_version }}" - secrets: inherit \ No newline at end of file + secrets: inherit From 2b39c73d56312663a5e6050787e9258ff827225f Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 28 Aug 2023 15:20:17 +0200 Subject: [PATCH 26/34] Update linux.yml --- .github/workflows/linux.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/linux.yml b/.github/workflows/linux.yml index 4d58dcee34..5a18199e3c 100644 --- a/.github/workflows/linux.yml +++ b/.github/workflows/linux.yml @@ -154,6 +154,11 @@ jobs: - name: Create the Packages (Bash) run: conan install $CURA_CONAN_VERSION ${{ inputs.conan_args }} --build=missing --update -if cura_inst -g VirtualPythonEnv -o cura:enterprise=$ENTERPRISE -o cura:staging=$STAGING --json "cura_inst/conan_install_info.json" + - name: Upload the Package(s) + if: always() + run: | + conan upload "*" -r cura --all -c + - name: Set Environment variables for Cura (bash) run: | . ./cura_inst/bin/activate_github_actions_env.sh From 608878d7be4d7ecd6ff3a42890c3bc8b9447ee46 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 28 Aug 2023 15:21:09 +0200 Subject: [PATCH 27/34] Update macos.yml --- .github/workflows/macos.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/macos.yml b/.github/workflows/macos.yml index 4690d27878..af1fc3d12b 100644 --- a/.github/workflows/macos.yml +++ b/.github/workflows/macos.yml @@ -154,6 +154,11 @@ jobs: - name: Create the Packages (Bash) run: conan install $CURA_CONAN_VERSION ${{ inputs.conan_args }} --build=missing --update -if cura_inst -g VirtualPythonEnv -o cura:enterprise=$ENTERPRISE -o cura:staging=$STAGING --json "cura_inst/conan_install_info.json" + - name: Upload the Package(s) + if: always() + run: | + conan upload "*" -r cura --all -c + - name: Set Environment variables for Cura (bash) run: | . ./cura_inst/bin/activate_github_actions_env.sh From 7671705c1619f8439056c22d121dcbb6d35ce1cd Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 28 Aug 2023 16:35:27 +0200 Subject: [PATCH 28/34] Update requirements-conan-package.txt --- .github/workflows/requirements-conan-package.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/requirements-conan-package.txt b/.github/workflows/requirements-conan-package.txt index 26d167db2b..5efbf3f18b 100644 --- a/.github/workflows/requirements-conan-package.txt +++ b/.github/workflows/requirements-conan-package.txt @@ -1,2 +1,2 @@ conan==1.56.0 -sip +sip==6.7.9 From d70b209288acf9ade307666823681eba36f2d531 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Mon, 28 Aug 2023 17:32:03 +0200 Subject: [PATCH 29/34] Update requirements-conan-package.txt --- .github/workflows/requirements-conan-package.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/requirements-conan-package.txt b/.github/workflows/requirements-conan-package.txt index 5efbf3f18b..48121932b8 100644 --- a/.github/workflows/requirements-conan-package.txt +++ b/.github/workflows/requirements-conan-package.txt @@ -1,2 +1,2 @@ conan==1.56.0 -sip==6.7.9 +sip==6.7.1 From 3d48e51ac2c55e3852598d7261bd7f1439027cb7 Mon Sep 17 00:00:00 2001 From: Jelle Spijker Date: Tue, 29 Aug 2023 07:53:35 +0200 Subject: [PATCH 30/34] Update requirements-conan-package.txt --- .github/workflows/requirements-conan-package.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/requirements-conan-package.txt b/.github/workflows/requirements-conan-package.txt index 48121932b8..6b4d4cffc8 100644 --- a/.github/workflows/requirements-conan-package.txt +++ b/.github/workflows/requirements-conan-package.txt @@ -1,2 +1,2 @@ -conan==1.56.0 -sip==6.7.1 +conan==1.60.2 +sip From ef4665a55f24ddb842deab5815b891bda385ee62 Mon Sep 17 00:00:00 2001 From: saumyaj3 Date: Tue, 29 Aug 2023 11:12:17 +0000 Subject: [PATCH 31/34] Applied printer-linter format --- .../matterhackers_pulsexe_e444m.def.json | 120 +++++++++--------- 1 file changed, 59 insertions(+), 61 deletions(-) diff --git a/resources/definitions/matterhackers_pulsexe_e444m.def.json b/resources/definitions/matterhackers_pulsexe_e444m.def.json index 05757b0679..fc5d4f6dda 100644 --- a/resources/definitions/matterhackers_pulsexe_e444m.def.json +++ b/resources/definitions/matterhackers_pulsexe_e444m.def.json @@ -1,62 +1,60 @@ -{ - "version": 2, - "name": "Pulse XE E-444M", - "inherits": "fdmprinter", - "metadata": - { - "visible": true, - "author": "Zwitch Guitars", - "manufacturer": "MatterHackers", - "file_formats": "text/x-gcode", - "has_materials": true, - "has_variants": false, - "has_machine_quality": false, - "preferred_material": "generic_pla", - "preferred_quality_type": "normal", - "first_start_actions": [ "MachineSettingsAction" ], - "machine_extruder_trains": - { - "0": "matterhackers_extruder" - } - }, - "overrides": - { - "machine_name": { "default_value": "Pulse XE E-444M" }, - "machine_gcode_flavor": { "default_value": "Marlin" }, - "machine_depth": { "default_value": 220 }, - "machine_height": { "default_value": 215 }, - "machine_width": { "default_value": 250 }, - "gantry_height": { "value": 23 }, - "machine_heated_bed": { "default_value": true }, - "machine_head_with_fans_polygon": - { - "default_value": [[-28, 45], [-28, -18], [40, 45], [40, -18]] - }, - "machine_steps_per_mm_x": {"value": 80}, - "machine_steps_per_mm_y": {"value": 80}, - "machine_steps_per_mm_z": {"value": 400}, - "machine_steps_per_mm_e": {"value": 415}, - "machine_max_feedrate_x": {"value": 300}, - "machine_max_feedrate_y": {"value": 300}, - "machine_max_feedrate_z": {"value": 30}, - "machine_max_feedrate_e": {"value": 75}, - "machine_acceleration": {"value": 1300}, - "material_diameter": { "value": 1.75 }, - - "adhesion_type": { "value": "skirt" }, - "cool_fan_full_at_height": { "value": "layer_height_0 + 2 * layer_height" }, - "cool_min_layer_time": { "value": 10 }, - "z_seam_type": { "value": "back" }, - "travel_retract_before_outer_wall": { "value": true }, - "optimize_wall_printing_order": { "value": true }, - "top_bottom_thickness": { "value": "layer_height_0 + layer_height * 3" }, - "wall_thickness": { "value": "line_width * 2" }, - - "speed_print": { "value": 50 }, - "speed_layer_0": { "value": 20.0 }, - - "machine_start_gcode": { "default_value": "G21 ; set units to millimeters\nG90 ; use absolute positioning\nM82 ; absolute extrusion mode\nG28 ; home axes\nM104 S{material_print_temperature_layer_0} ; set extruder temp\nM140 S{material_bed_temperature_layer_0} ; set bed temp\nM190 S{material_bed_temperature_layer_0} ; wait for bed temp\nM109 S{material_print_temperature_layer_0} ; wait for extruder temp\nG29 ; mesh bed leveling\n\nG92 E0\nG1 X5 Y5 Z0.8 F1800\nG1 X100 Z0.3 E25 F900\nG92 E0\nG1 E-2 F2400"}, - "machine_end_gcode": { "default_value": "M104 S0 ; turn off extruder\nM140 S0 ; turn off heatbed\nM107 ; turn off fan\nG1 X0 Y{machine_depth}; home X axis and push Y forward\nG28 Z0\nM84 ; disable motors" } - - } +{ + "version": 2, + "name": "Pulse XE E-444M", + "inherits": "fdmprinter", + "metadata": + { + "visible": true, + "author": "Zwitch Guitars", + "manufacturer": "MatterHackers", + "file_formats": "text/x-gcode", + "first_start_actions": [ "MachineSettingsAction" ], + "has_machine_quality": false, + "has_materials": true, + "has_variants": false, + "machine_extruder_trains": { "0": "matterhackers_extruder" }, + "preferred_material": "generic_pla", + "preferred_quality_type": "normal" + }, + "overrides": + { + "adhesion_type": { "value": "skirt" }, + "cool_fan_full_at_height": { "value": "layer_height_0 + 2 * layer_height" }, + "cool_min_layer_time": { "value": 10 }, + "gantry_height": { "value": 23 }, + "machine_acceleration": { "value": 1300 }, + "machine_depth": { "default_value": 220 }, + "machine_end_gcode": { "default_value": "M104 S0 ; turn off extruder\nM140 S0 ; turn off heatbed\nM107 ; turn off fan\nG1 X0 Y{machine_depth}; home X axis and push Y forward\nG28 Z0\nM84 ; disable motors" }, + "machine_gcode_flavor": { "default_value": "Marlin" }, + "machine_head_with_fans_polygon": + { + "default_value": [ + [-28, 45], + [-28, -18], + [40, 45], + [40, -18] + ] + }, + "machine_heated_bed": { "default_value": true }, + "machine_height": { "default_value": 215 }, + "machine_max_feedrate_e": { "value": 75 }, + "machine_max_feedrate_x": { "value": 300 }, + "machine_max_feedrate_y": { "value": 300 }, + "machine_max_feedrate_z": { "value": 30 }, + "machine_name": { "default_value": "Pulse XE E-444M" }, + "machine_start_gcode": { "default_value": "G21 ; set units to millimeters\nG90 ; use absolute positioning\nM82 ; absolute extrusion mode\nG28 ; home axes\nM104 S{material_print_temperature_layer_0} ; set extruder temp\nM140 S{material_bed_temperature_layer_0} ; set bed temp\nM190 S{material_bed_temperature_layer_0} ; wait for bed temp\nM109 S{material_print_temperature_layer_0} ; wait for extruder temp\nG29 ; mesh bed leveling\n\nG92 E0\nG1 X5 Y5 Z0.8 F1800\nG1 X100 Z0.3 E25 F900\nG92 E0\nG1 E-2 F2400" }, + "machine_steps_per_mm_e": { "value": 415 }, + "machine_steps_per_mm_x": { "value": 80 }, + "machine_steps_per_mm_y": { "value": 80 }, + "machine_steps_per_mm_z": { "value": 400 }, + "machine_width": { "default_value": 250 }, + "material_diameter": { "value": 1.75 }, + "optimize_wall_printing_order": { "value": true }, + "speed_layer_0": { "value": 20.0 }, + "speed_print": { "value": 50 }, + "top_bottom_thickness": { "value": "layer_height_0 + layer_height * 3" }, + "travel_retract_before_outer_wall": { "value": true }, + "wall_thickness": { "value": "line_width * 2" }, + "z_seam_type": { "value": "back" } + } } \ No newline at end of file From 6e045e8b37619cea7ff484e6e99b857637204f8c Mon Sep 17 00:00:00 2001 From: "c.lamboo" Date: Tue, 29 Aug 2023 14:11:36 +0200 Subject: [PATCH 32/34] Put back `getAnyExtruderPositionWithOrDefault` api function CURA-10685 --- cura/CuraApplication.py | 2 ++ cura/Settings/CuraFormulaFunctions.py | 9 +++++++++ docs/profiles/getting_a_setting_value.md | 3 +++ 3 files changed, 14 insertions(+) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index f44393657f..0de3ccc780 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -410,6 +410,8 @@ class CuraApplication(QtApplication): SettingFunction.registerOperator("extruderValue", self._cura_formula_functions.getValueInExtruder) SettingFunction.registerOperator("extruderValues", self._cura_formula_functions.getValuesInAllExtruders) SettingFunction.registerOperator("anyExtruderWithMaterial", self._cura_formula_functions.getExtruderPositionWithMaterial) + SettingFunction.registerOperator("anyExtruderNrWithOrDefault", + self._cura_formula_functions.getAnyExtruderPositionWithOrDefault) SettingFunction.registerOperator("resolveOrValue", self._cura_formula_functions.getResolveOrValue) SettingFunction.registerOperator("defaultExtruderPosition", self._cura_formula_functions.getDefaultExtruderPosition) SettingFunction.registerOperator("valueFromContainer", self._cura_formula_functions.getValueFromContainerAtIndex) diff --git a/cura/Settings/CuraFormulaFunctions.py b/cura/Settings/CuraFormulaFunctions.py index 08c24180bb..d7b6228e09 100644 --- a/cura/Settings/CuraFormulaFunctions.py +++ b/cura/Settings/CuraFormulaFunctions.py @@ -97,6 +97,15 @@ class CuraFormulaFunctions: return result + # Get the first extruder that adheres to a specific (boolean) property, like 'material_is_support_material'. + def getAnyExtruderPositionWithOrDefault(self, filter_key: str, + context: Optional["PropertyEvaluationContext"] = None) -> str: + for extruder in self._getActiveExtruders(context): + value = extruder.getRawProperty(filter_key, "value", context=context) + if value is None or not value: + continue + return str(extruder.position) + # Get the first extruder with material that adheres to a specific (boolean) property, like 'material_is_support_material'. def getExtruderPositionWithMaterial(self, filter_key: str, context: Optional["PropertyEvaluationContext"] = None) -> str: diff --git a/docs/profiles/getting_a_setting_value.md b/docs/profiles/getting_a_setting_value.md index ab18be0f42..7cd912ac45 100644 --- a/docs/profiles/getting_a_setting_value.md +++ b/docs/profiles/getting_a_setting_value.md @@ -54,6 +54,9 @@ There are also a few extra things that can be used in these expressions: * The function `extruderValue(extruder, key)` will evaluate a particular setting for a particular extruder. * The function `resolveOrValue(key)` will perform the full setting evaluation as described in this document for the current context (so if this setting is being evaluated for the second extruder it would perform it as if coming from the second extruder). * The function `defaultExtruderPosition()` will get the first extruder that is not disabled. For instance, if a printer has three extruders but the first is disabled, this would return `1` to indicate the second extruder (0-indexed). +* The function `anyExtruderNrWithOrDefault(key)` will filter the list of extruders on the key, and then give the first + index for which it is true, or if none of them are, the default one as specified by the 'default extruder position' + function above. * The function `anyExtruderWithMaterial(key)` will filter the list of extruders on the key of material quality, and then give the first index for which it is true, or if none of them are, the default one as specified by the 'default extruder position' function above. * The function `valueFromContainer(key, index)` will get a setting value from the global stack, but skip the first few containers in that stack. It will skip until it reaches a particular index in the container stack. * The function `extruderValueFromContainer(key, index)` will get a setting value from the current extruder stack, but skip the first few containers in that stack. It will skip until it reaches a particular index in the container stack. From 0397095789dad159e6ff25eae06a31cbe679941a Mon Sep 17 00:00:00 2001 From: "saumya.jain" Date: Tue, 29 Aug 2023 15:18:59 +0200 Subject: [PATCH 33/34] pyarcus pynest2d and pysavitar version changed conan build fix --- conanfile.py | 66 +++++++++++++++++++++++++++++----------------------- 1 file changed, 37 insertions(+), 29 deletions(-) diff --git a/conanfile.py b/conanfile.py index 77cecf1134..3c836dae2a 100644 --- a/conanfile.py +++ b/conanfile.py @@ -10,7 +10,7 @@ from conan.tools.env import VirtualRunEnv, Environment, VirtualBuildEnv from conan.tools.scm import Version from conan.errors import ConanInvalidConfiguration, ConanException -required_conan_version = ">=1.54 <=1.56.0 || >=1.58.0 <2.0.0" +required_conan_version = ">=1.58.0 <2.0.0" class CuraConan(ConanFile): @@ -293,6 +293,7 @@ class CuraConan(ConanFile): self.options["pysavitar"].shared = True self.options["pynest2d"].shared = True self.options["cpython"].shared = True + self.options["boost"].header_only = True def validate(self): version = self.conf_info.get("user.cura:version", default = self.version, check_type = str) @@ -300,10 +301,11 @@ class CuraConan(ConanFile): raise ConanInvalidConfiguration("Only versions 5+ are support") def requirements(self): - self.requires("pyarcus/5.2.2") + self.requires("boost/1.82.0") + self.requires("pyarcus/(latest)@ultimaker/cura_10951") self.requires("curaengine/(latest)@ultimaker/testing") - self.requires("pysavitar/5.2.2") - self.requires("pynest2d/5.2.2") + self.requires("pysavitar/(latest)@ultimaker/cura_10951") + self.requires("pynest2d/(latest)@ultimaker/cura_10951") self.requires("uranium/(latest)@ultimaker/testing") self.requires("cura_binary_data/(latest)@ultimaker/testing") self.requires("cpython/3.10.4") @@ -338,7 +340,38 @@ class CuraConan(ConanFile): vr.generate() self._generate_cura_version(os.path.join(self.source_folder, "cura")) + self._generate_about_versions(os.path.join(self.source_folder, "resources","qml", "Dialogs")) + if not self.in_local_cache: + # Copy CuraEngine.exe to bindirs of Virtual Python Environment + curaengine = self.dependencies["curaengine"].cpp_info + copy(self, "CuraEngine.exe", curaengine.bindirs[0], self.source_folder, keep_path = False) + copy(self, "CuraEngine", curaengine.bindirs[0], self.source_folder, keep_path = False) + + # Copy resources of cura_binary_data + cura_binary_data = self.dependencies["cura_binary_data"].cpp_info + copy(self, "*", cura_binary_data.resdirs[0], str(self._share_dir.joinpath("cura")), keep_path = True) + copy(self, "*", cura_binary_data.resdirs[1], str(self._share_dir.joinpath("uranium")), keep_path = True) + if self.settings.os == "Windows": + copy(self, "*", cura_binary_data.resdirs[2], str(self._share_dir.joinpath("windows")), keep_path = True) + + for dependency in self.dependencies.host.values(): + for bindir in dependency.cpp_info.bindirs: + copy(self, "*.dll", bindir, str(self._site_packages), keep_path = False) + for libdir in dependency.cpp_info.libdirs: + copy(self, "*.pyd", libdir, str(self._site_packages), keep_path = False) + copy(self, "*.pyi", libdir, str(self._site_packages), keep_path = False) + copy(self, "*.dylib", libdir, str(self._base_dir.joinpath("lib")), keep_path = False) + + # Copy materials (flat) + rmdir(self, os.path.join(self.source_folder, "resources", "materials")) + fdm_materials = self.dependencies["fdm_materials"].cpp_info + copy(self, "*", fdm_materials.resdirs[0], str(self._share_dir.joinpath("cura"))) + + # Copy internal resources + if self.options.internal: + cura_private_data = self.dependencies["cura_private_data"].cpp_info + copy(self, "*", cura_private_data.resdirs[0], str(self._share_dir.joinpath("cura"))) if self.options.devtools: entitlements_file = "'{}'".format(os.path.join(self.source_folder, "packaging", "MacOS", "cura.entitlements")) @@ -357,8 +390,6 @@ class CuraConan(ConanFile): pot = self.python_requires["translationextractor"].module.ExtractTranslations(self, cpp_info.bindirs[0]) pot.generate() - self._generate_about_versions(os.path.join(self.source_folder, "resources","qml", "Dialogs")) - def build(self): if self.options.devtools: if self.settings.os != "Windows" or self.conf.get("tools.microsoft.bash:path", check_type = str): @@ -370,29 +401,6 @@ class CuraConan(ConanFile): cpp_info = self.dependencies["gettext"].cpp_info self.run(f"{cpp_info.bindirs[0]}/msgfmt {po_file} -o {mo_file} -f", env="conanbuild", ignore_errors=True) - def imports(self): - self.copy("CuraEngine.exe", root_package = "curaengine", src = "@bindirs", dst = "", keep_path = False) - self.copy("CuraEngine", root_package = "curaengine", src = "@bindirs", dst = "", keep_path = False) - - rmdir(self, os.path.join(self.source_folder, "resources", "materials")) - self.copy("*.fdm_material", root_package = "fdm_materials", src = "@resdirs", dst = "resources/materials", keep_path = False) - self.copy("*.sig", root_package = "fdm_materials", src = "@resdirs", dst = "resources/materials", keep_path = False) - - if self.options.internal: - self.copy("*", root_package = "cura_private_data", src = self.deps_cpp_info["cura_private_data"].resdirs[0], - dst = self._share_dir.joinpath("cura", "resources"), keep_path = True) - - # Copy resources of cura_binary_data - self.copy("*", root_package = "cura_binary_data", src = self.deps_cpp_info["cura_binary_data"].resdirs[0], - dst = self._share_dir.joinpath("cura", "resources"), keep_path = True) - self.copy("*", root_package = "cura_binary_data", src = self.deps_cpp_info["cura_binary_data"].resdirs[1], - dst =self._share_dir.joinpath("uranium", "resources"), keep_path = True) - - self.copy("*.dll", src = "@bindirs", dst = self._site_packages) - self.copy("*.pyd", src = "@libdirs", dst = self._site_packages) - self.copy("*.pyi", src = "@libdirs", dst = self._site_packages) - self.copy("*.dylib", src = "@libdirs", dst = self._script_dir) - def deploy(self): # Copy CuraEngine.exe to bindirs of Virtual Python Environment curaengine = self.dependencies["curaengine"].cpp_info From d80e349f0b22985b027ecd376242cf0b5b4f1652 Mon Sep 17 00:00:00 2001 From: "saumya.jain" Date: Tue, 29 Aug 2023 15:27:47 +0200 Subject: [PATCH 34/34] source_folder as root for materials conan build fix --- conanfile.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conanfile.py b/conanfile.py index 3c836dae2a..1ab7d939af 100644 --- a/conanfile.py +++ b/conanfile.py @@ -366,7 +366,7 @@ class CuraConan(ConanFile): # Copy materials (flat) rmdir(self, os.path.join(self.source_folder, "resources", "materials")) fdm_materials = self.dependencies["fdm_materials"].cpp_info - copy(self, "*", fdm_materials.resdirs[0], str(self._share_dir.joinpath("cura"))) + copy(self, "*", fdm_materials.resdirs[0], self.source_folder) # Copy internal resources if self.options.internal: