diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index 49b0026b39..4a1023f69e 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -1106,88 +1106,6 @@ class CuraApplication(QtApplication): self._platform_activity = True if count > 0 else False self.activityChanged.emit() - # Remove all selected objects from the scene. - @pyqtSlot() - @deprecated("Moved to CuraActions", "2.6") - def deleteSelection(self): - if not self.getController().getToolsEnabled(): - return - removed_group_nodes = [] - op = GroupedOperation() - nodes = Selection.getAllSelectedObjects() - for node in nodes: - op.addOperation(RemoveSceneNodeOperation(node)) - group_node = node.getParent() - if group_node and group_node.callDecoration("isGroup") and group_node not in removed_group_nodes: - remaining_nodes_in_group = list(set(group_node.getChildren()) - set(nodes)) - if len(remaining_nodes_in_group) == 1: - removed_group_nodes.append(group_node) - op.addOperation(SetParentOperation(remaining_nodes_in_group[0], group_node.getParent())) - op.addOperation(RemoveSceneNodeOperation(group_node)) - op.push() - - ## Remove an object from the scene. - # Note that this only removes an object if it is selected. - @pyqtSlot("quint64") - @deprecated("Use deleteSelection instead", "2.6") - def deleteObject(self, object_id): - if not self.getController().getToolsEnabled(): - return - - node = self.getController().getScene().findObject(object_id) - - if not node and object_id != 0: # Workaround for tool handles overlapping the selected object - node = Selection.getSelectedObject(0) - - if node: - op = GroupedOperation() - op.addOperation(RemoveSceneNodeOperation(node)) - - group_node = node.getParent() - if group_node: - # Note that at this point the node has not yet been deleted - if len(group_node.getChildren()) <= 2 and group_node.callDecoration("isGroup"): - op.addOperation(SetParentOperation(group_node.getChildren()[0], group_node.getParent())) - op.addOperation(RemoveSceneNodeOperation(group_node)) - - op.push() - - ## Create a number of copies of existing object. - # \param object_id - # \param count number of copies - # \param min_offset minimum offset to other objects. - @pyqtSlot("quint64", int) - @deprecated("Use CuraActions::multiplySelection", "2.6") - def multiplyObject(self, object_id, count, min_offset = 8): - node = self.getController().getScene().findObject(object_id) - if not node: - node = Selection.getSelectedObject(0) - - while node.getParent() and node.getParent().callDecoration("isGroup"): - node = node.getParent() - - job = MultiplyObjectsJob([node], count, min_offset) - job.start() - return - - ## Center object on platform. - @pyqtSlot("quint64") - @deprecated("Use CuraActions::centerSelection", "2.6") - def centerObject(self, object_id): - node = self.getController().getScene().findObject(object_id) - if not node and object_id != 0: # Workaround for tool handles overlapping the selected object - node = Selection.getSelectedObject(0) - - if not node: - return - - if node.getParent() and node.getParent().callDecoration("isGroup"): - node = node.getParent() - - if node: - op = SetTransformOperation(node, Vector()) - op.push() - ## Select all nodes containing mesh data in the scene. @pyqtSlot() def selectAll(self):