Skip to content

Commit

Permalink
Only convert to yes/no if value is a boolean
Browse files Browse the repository at this point in the history
  • Loading branch information
Frederic98 authored and HellAholic committed Aug 28, 2024
1 parent 946bf03 commit 4064ddd
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions plugins/XmlMaterialProfile/XmlMaterialProfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1083,9 +1083,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)

Expand Down

0 comments on commit 4064ddd

Please sign in to comment.