From b7f3108491d4d8be309ffa98a17a45fc5542f6fb Mon Sep 17 00:00:00 2001 From: Frederic98 <13856291+Frederic98@users.noreply.github.com> Date: Thu, 26 Sep 2024 11:31:05 +0200 Subject: [PATCH] Fix setting relationships to update UI properly. --- cura/BuildVolume.py | 1 + resources/definitions/fdmextruder.def.json | 11 +++++++++++ resources/definitions/fdmprinter.def.json | 18 +++++++++--------- 3 files changed, 21 insertions(+), 9 deletions(-) diff --git a/cura/BuildVolume.py b/cura/BuildVolume.py index 37c4c61a7ce..e9e1544afd3 100755 --- a/cura/BuildVolume.py +++ b/cura/BuildVolume.py @@ -810,6 +810,7 @@ def _updateUsedExtruders(self): for extruder in global_container_stack.extruderList: used = extruder in used_extruders extruder.definitionChanges.setProperty("extruder_used", "value", used) + global_container_stack.definitionChanges.setProperty("extruders_used", "value", [extruder.position for extruder in used_extruders]) def _nodeActiveExtruderChanged(self): self._updateDisallowedAreasAndRebuild() diff --git a/resources/definitions/fdmextruder.def.json b/resources/definitions/fdmextruder.def.json index a0fffeeaec0..c45256fb8ad 100644 --- a/resources/definitions/fdmextruder.def.json +++ b/resources/definitions/fdmextruder.def.json @@ -27,6 +27,17 @@ "settable_per_meshgroup": false, "type": "extruder" }, + "extruder_used": + { + "default_value": true, + "description": "Is this extruder used for printing. This setting is controlled by Cura automatically.", + "label": "Extruder Used", + "settable_globally": false, + "settable_per_extruder": true, + "settable_per_mesh": false, + "settable_per_meshgroup": false, + "type": "bool" + }, "extruder_prime_pos_z": { "default_value": 0, diff --git a/resources/definitions/fdmprinter.def.json b/resources/definitions/fdmprinter.def.json index 171b3fd4e8e..92ab524741d 100644 --- a/resources/definitions/fdmprinter.def.json +++ b/resources/definitions/fdmprinter.def.json @@ -289,16 +289,16 @@ "settable_per_extruder": false, "settable_per_meshgroup": false }, - "extruder_used": + "extruders_used": { - "default_value": true, - "description": "Is this extruder used for printing. This setting is controlled by Cura automatically.", - "label": "Extruder Used", - "settable_globally": false, - "settable_per_extruder": true, + "default_value": [], + "description": "A list of extruder positions that are used. This setting is controlled by Cura automatically.", + "label": "Extruders Used", + "settable_globally": true, + "settable_per_extruder": false, "settable_per_mesh": false, "settable_per_meshgroup": false, - "type": "bool" + "type": "[int]" }, "machine_nozzle_tip_outer_diameter": { @@ -2494,7 +2494,7 @@ "enabled": "machine_heated_build_volume", "settable_per_mesh": false, "settable_per_extruder": false, - "depends_on_settings": [ "extruder_used" ] + "depends_on_settings": [ "extruders_used" ] }, "material_print_temperature": { @@ -2608,7 +2608,7 @@ "settable_per_mesh": false, "settable_per_extruder": false, "settable_per_meshgroup": false, - "depends_on_settings": [ "extruder_used" ] + "depends_on_settings": [ "extruders_used" ] }, "material_bed_temperature_layer_0": {