Просмотр исходного кода

Maintain a selection when removing a mesh, so the tool stays active

fieldOfView 7 лет назад
Родитель
Сommit
78a7299fc5
1 измененных файлов с 7 добавлено и 0 удалено
  1. 7 0
      plugins/SupportEraser/SupportEraser.py

+ 7 - 0
plugins/SupportEraser/SupportEraser.py

@@ -126,9 +126,16 @@ class SupportEraser(Tool):
         Application.getInstance().getController().getScene().sceneChanged.emit(node)
 
     def _removeEraserMesh(self, node: CuraSceneNode):
+        parent = node.getParent()
+        if parent == self._controller.getScene().getRoot():
+            parent = None
+
         op = RemoveSceneNodeOperation(node)
         op.push()
 
+        if parent and not Selection.isSelected(parent):
+            Selection.add(parent)
+
         Application.getInstance().getController().getScene().sceneChanged.emit(node)
 
     def _updateEnabled(self):