Merge branch '3.2'

This commit is contained in:
Jack Ha 2018-01-22 12:58:16 +01:00
commit 4c474c9619
2 changed files with 9 additions and 7 deletions

View file

@ -1063,8 +1063,9 @@ class CuraApplication(QtApplication):
Selection.add(node)
## Delete all nodes containing mesh data in the scene.
# \param only_selectable. Set this to False to delete objects from all build plates
@pyqtSlot()
def deleteAll(self):
def deleteAll(self, only_selectable = True):
Logger.log("i", "Clearing scene")
if not self.getController().getToolsEnabled():
return
@ -1075,7 +1076,9 @@ class CuraApplication(QtApplication):
continue
if (not node.getMeshData() and not node.callDecoration("getLayerData")) and not node.callDecoration("isGroup"):
continue # Node that doesnt have a mesh and is not a group.
if not node.isSelectable():
if only_selectable and not node.isSelectable():
continue
if not node.callDecoration("isSliceable"):
continue # Only remove nodes that are selectable.
if node.getParent() and node.getParent().callDecoration("isGroup"):
continue # Grouped nodes don't need resetting as their parent (the group) is resetted)
@ -1455,7 +1458,7 @@ class CuraApplication(QtApplication):
self._currently_loading_files.append(f)
if extension in self._non_sliceable_extensions:
self.deleteAll()
self.deleteAll(only_selectable = False)
job = ReadMeshJob(f)
job.finished.connect(self._readMeshFinished)