mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 05:29:01 +08:00
Fix deleting grouped object using the context-menu
CURA-2573
This commit is contained in:
parent
b4a2a0a417
commit
879ab529f2
@ -646,8 +646,6 @@ class CuraApplication(QtApplication):
|
|||||||
op.addOperation(RemoveSceneNodeOperation(group_node))
|
op.addOperation(RemoveSceneNodeOperation(group_node))
|
||||||
op.push()
|
op.push()
|
||||||
|
|
||||||
pass
|
|
||||||
|
|
||||||
## Remove an object from the scene.
|
## Remove an object from the scene.
|
||||||
# Note that this only removes an object if it is selected.
|
# Note that this only removes an object if it is selected.
|
||||||
@pyqtSlot("quint64")
|
@pyqtSlot("quint64")
|
||||||
@ -661,16 +659,16 @@ class CuraApplication(QtApplication):
|
|||||||
node = Selection.getSelectedObject(0)
|
node = Selection.getSelectedObject(0)
|
||||||
|
|
||||||
if node:
|
if node:
|
||||||
group_node = None
|
op = GroupedOperation()
|
||||||
if node.getParent():
|
op.addOperation(RemoveSceneNodeOperation(node))
|
||||||
group_node = node.getParent()
|
|
||||||
op = RemoveSceneNodeOperation(node)
|
|
||||||
|
|
||||||
op.push()
|
group_node = node.getParent()
|
||||||
if group_node:
|
if group_node:
|
||||||
if len(group_node.getChildren()) == 1 and group_node.callDecoration("isGroup"):
|
# 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(SetParentOperation(group_node.getChildren()[0], group_node.getParent()))
|
||||||
op = RemoveSceneNodeOperation(group_node)
|
op.addOperation(RemoveSceneNodeOperation(group_node))
|
||||||
|
|
||||||
op.push()
|
op.push()
|
||||||
|
|
||||||
## Create a number of copies of existing object.
|
## Create a number of copies of existing object.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user