mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-06-04 11:14:21 +08:00
Remove group when "parent" is the only node in the group
This commit is contained in:
parent
c3c096aaa0
commit
b9bf78d36c
@ -125,10 +125,24 @@ class SupportEraser(Tool):
|
||||
Selection.add(parent)
|
||||
|
||||
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()
|
||||
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):
|
||||
plugin_enabled = False
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user