mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-06 22:47:29 -06:00
Remove group when "parent" is the only node in the group
This commit is contained in:
parent
c3c096aaa0
commit
b9bf78d36c
1 changed files with 15 additions and 1 deletions
|
@ -125,10 +125,24 @@ class SupportEraser(Tool):
|
||||||
Selection.add(parent)
|
Selection.add(parent)
|
||||||
|
|
||||||
def _removeEraserMesh(self, node: CuraSceneNode):
|
def _removeEraserMesh(self, node: CuraSceneNode):
|
||||||
op = RemoveSceneNodeOperation(node)
|
group = node.getParent()
|
||||||
|
if group.callDecoration("isGroup"):
|
||||||
|
parent = group.getChildren()[0]
|
||||||
|
|
||||||
|
op = GroupedOperation()
|
||||||
|
op.addOperation(RemoveSceneNodeOperation(node))
|
||||||
|
if len(group.getChildren()) == 2:
|
||||||
|
op.addOperation(SetParentOperation(parent, group.getParent()))
|
||||||
|
|
||||||
op.push()
|
op.push()
|
||||||
Application.getInstance().getController().getScene().sceneChanged.emit(node)
|
Application.getInstance().getController().getScene().sceneChanged.emit(node)
|
||||||
|
|
||||||
|
# Select the picked node so the group does not get drawn as a wireframe (yet)
|
||||||
|
if Selection.isSelected(group):
|
||||||
|
Selection.remove(group)
|
||||||
|
if parent and not Selection.isSelected(parent):
|
||||||
|
Selection.add(parent)
|
||||||
|
|
||||||
def _updateEnabled(self):
|
def _updateEnabled(self):
|
||||||
plugin_enabled = False
|
plugin_enabled = False
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue