|
@@ -1040,8 +1040,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
|
|
@@ -1052,7 +1053,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)
|
|
@@ -1431,7 +1434,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)
|