mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-24 07:03:56 -06:00
Merge branch '2.1' of https://github.com/Ultimaker/Cura into 2.1
This commit is contained in:
commit
ccfa4a4842
2 changed files with 11 additions and 4 deletions
|
@ -255,13 +255,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
|
||||
|
|
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue