From b8417bcccbde323159af5dcdf6d5bb29ca70bbf3 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Wed, 23 May 2018 09:34:21 +0200 Subject: [PATCH 1/3] If the label tag exists in the xml material file, but without any string in it, the label.text return None and then it makes Cura crashing when creating the models. This is intended to fix the issue #3750 --- plugins/XmlMaterialProfile/XmlMaterialProfile.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/plugins/XmlMaterialProfile/XmlMaterialProfile.py b/plugins/XmlMaterialProfile/XmlMaterialProfile.py index 6dcd5a5ccc..6e9f2af911 100644 --- a/plugins/XmlMaterialProfile/XmlMaterialProfile.py +++ b/plugins/XmlMaterialProfile/XmlMaterialProfile.py @@ -514,7 +514,7 @@ class XmlMaterialProfile(InstanceContainer): color = entry.find("./um:color", self.__namespaces) label = entry.find("./um:label", self.__namespaces) - if label is not None: + if label is not None and label.text is not None: meta_data["name"] = label.text else: meta_data["name"] = self._profile_name(material.text, color.text) @@ -805,7 +805,9 @@ class XmlMaterialProfile(InstanceContainer): color = entry.find("./um:color", cls.__namespaces) label = entry.find("./um:label", cls.__namespaces) - if label is not None: + if "Rigid" in brand.text: + print("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@", label, label is not None, label.text if label is not None else ":") + if label is not None and label.text is not None: base_metadata["name"] = label.text else: base_metadata["name"] = cls._profile_name(material.text, color.text) From ba234f5c8a43f382e05e6728134b353949465fa9 Mon Sep 17 00:00:00 2001 From: Diego Prado Gesto Date: Wed, 23 May 2018 09:38:16 +0200 Subject: [PATCH 2/3] Remove debug prints --- plugins/XmlMaterialProfile/XmlMaterialProfile.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/plugins/XmlMaterialProfile/XmlMaterialProfile.py b/plugins/XmlMaterialProfile/XmlMaterialProfile.py index 6e9f2af911..70d07c1fc5 100644 --- a/plugins/XmlMaterialProfile/XmlMaterialProfile.py +++ b/plugins/XmlMaterialProfile/XmlMaterialProfile.py @@ -805,8 +805,6 @@ class XmlMaterialProfile(InstanceContainer): color = entry.find("./um:color", cls.__namespaces) label = entry.find("./um:label", cls.__namespaces) - if "Rigid" in brand.text: - print("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@", label, label is not None, label.text if label is not None else ":") if label is not None and label.text is not None: base_metadata["name"] = label.text else: From 7136b8649a3c6aac5556ca42f6e4635da62c4340 Mon Sep 17 00:00:00 2001 From: Jack Ha Date: Wed, 23 May 2018 10:48:19 +0200 Subject: [PATCH 3/3] CURA-5388 disable automatic_push_free / Ensure models are kept apart by default --- cura/PlatformPhysics.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/PlatformPhysics.py b/cura/PlatformPhysics.py index 1a5d6ef837..b22552d8c5 100755 --- a/cura/PlatformPhysics.py +++ b/cura/PlatformPhysics.py @@ -36,7 +36,7 @@ class PlatformPhysics: self._max_overlap_checks = 10 # How many times should we try to find a new spot per tick? self._minimum_gap = 2 # It is a minimum distance (in mm) between two models, applicable for small models - Preferences.getInstance().addPreference("physics/automatic_push_free", True) + Preferences.getInstance().addPreference("physics/automatic_push_free", False) Preferences.getInstance().addPreference("physics/automatic_drop_down", True) def _onSceneChanged(self, source):