From a18da5c9bd44f758ea0ab0179d0195d454a8cb36 Mon Sep 17 00:00:00 2001 From: Frederic Meeuwissen <13856291+Frederic98@users.noreply.github.com> Date: Mon, 26 Aug 2024 13:12:03 +0200 Subject: [PATCH] Only convert to yes/no if value is a boolean --- plugins/XmlMaterialProfile/XmlMaterialProfile.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/plugins/XmlMaterialProfile/XmlMaterialProfile.py b/plugins/XmlMaterialProfile/XmlMaterialProfile.py index 49b5e7661dc..13111c1c7a2 100644 --- a/plugins/XmlMaterialProfile/XmlMaterialProfile.py +++ b/plugins/XmlMaterialProfile/XmlMaterialProfile.py @@ -1084,9 +1084,8 @@ def _addSettingElement(self, builder, instance): # Skip material properties (eg diameter) or metadata (eg GUID) return - truth_map = { True: "yes", False: "no" } - if tag_name != "cura:setting" and instance.value in truth_map: - data = truth_map[instance.value] + if tag_name != "cura:setting" and isinstance(instance.value, bool): + data = "yes" if instance.value else "no" else: data = str(instance.value)