From 461a3fb0d629fc767248a7c9cf401cafde4702a2 Mon Sep 17 00:00:00 2001 From: fieldOfView Date: Tue, 12 Jan 2016 10:48:37 +0100 Subject: [PATCH 1/2] Don't include origin in boundingbox --- cura/CuraApplication.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 59495bd66a..1c235f9888 100644 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -254,13 +254,19 @@ class CuraApplication(QtApplication): def updatePlatformActivity(self, node = None): count = 0 - scene_boundingbox = AxisAlignedBox() + scene_boundingbox = None for node in DepthFirstIterator(self.getController().getScene().getRoot()): if type(node) is not SceneNode or not node.getMeshData(): continue count += 1 - scene_boundingbox += node.getBoundingBox() + if not scene_boundingbox: + scene_boundingbox = node.getBoundingBox() + else: + scene_boundingbox += node.getBoundingBox() + + if not scene_boundingbox: + scene_boundingbox = AxisAlignedBox() if repr(self._scene_boundingbox) != repr(scene_boundingbox): self._scene_boundingbox = scene_boundingbox From e23a9ea9970860f6ac0a8279feece6bca4213839 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Wed, 20 Jan 2016 14:42:32 +0100 Subject: [PATCH 2/2] Move the changing of the setting after import out of try-except It should never give an exception, so if it does, crash and burn the application. Contributes to issue CURA-37. --- plugins/LegacyProfileReader/LegacyProfileReader.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/plugins/LegacyProfileReader/LegacyProfileReader.py b/plugins/LegacyProfileReader/LegacyProfileReader.py index b32a317688..923c6f92f9 100644 --- a/plugins/LegacyProfileReader/LegacyProfileReader.py +++ b/plugins/LegacyProfileReader/LegacyProfileReader.py @@ -98,9 +98,10 @@ class LegacyProfileReader(ProfileReader): compiled = compile(old_setting_expression, new_setting, "eval") try: new_value = eval(compiled, {"math": math}, legacy_settings) #Pass the legacy settings as local variables to allow access to in the evaluation. - if profile.getSettingValue(new_setting) != new_value: #Not equal to the default. - profile.setSettingValue(new_setting, new_value) #Store the setting in the profile! except Exception as e: #Probably some setting name that was missing or something else that went wrong in the ini file. Logger.log("w", "Setting " + new_setting + " could not be set because the evaluation failed. Something is probably missing from the imported legacy profile.") + continue + if profile.getSettingValue(new_setting) != new_value: #Not equal to the default. + profile.setSettingValue(new_setting, new_value) #Store the setting in the profile! return profile \ No newline at end of file