From 3faccd5b3e99c0eafb94de4e377bb020dda4e8ec Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Tue, 23 Jun 2015 14:56:51 +0200 Subject: [PATCH] If findObject returns none but object_id != 0 use the selected object This works around an issue where the tool handles overlap the selected object and thus context menu entries would not work. Fixes #64 --- cura/CuraApplication.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index be663545e6..1e7936f0c9 100644 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -215,6 +215,9 @@ class CuraApplication(QtApplication): def deleteObject(self, object_id): object = self.getController().getScene().findObject(object_id) + if not object and object_id != 0: #Workaround for tool handles overlapping the selected object + object = Selection.getSelectedObject(0) + if object: op = RemoveSceneNodeOperation(object) op.push() @@ -224,6 +227,9 @@ class CuraApplication(QtApplication): def multiplyObject(self, object_id, count): 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() for i in range(count): @@ -240,6 +246,9 @@ class CuraApplication(QtApplication): 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 node: op = SetTransformOperation(node, Vector()) op.push()