mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-14 20:35:54 +08:00
Added ungrouping
This commit is contained in:
parent
e3deff89f7
commit
d01279c115
@ -428,6 +428,23 @@ class CuraApplication(QtApplication):
|
|||||||
for node in Selection.getAllSelectedObjects():
|
for node in Selection.getAllSelectedObjects():
|
||||||
node.setParent(group_node)
|
node.setParent(group_node)
|
||||||
|
|
||||||
|
@pyqtSlot()
|
||||||
|
def ungroupSelected(self):
|
||||||
|
ungrouped_nodes = []
|
||||||
|
for node in Selection.getAllSelectedObjects():
|
||||||
|
if node.callDecoration("isGroup" ):
|
||||||
|
children_to_move = []
|
||||||
|
for child in node.getChildren():
|
||||||
|
if child.getMeshData() is not None:
|
||||||
|
children_to_move.append(child)
|
||||||
|
|
||||||
|
for child in children_to_move:
|
||||||
|
child.setParent(node.getParent())
|
||||||
|
child.callDecoration("setConvexHull",None)
|
||||||
|
node.setParent(None)
|
||||||
|
ungrouped_nodes.append(node)
|
||||||
|
for node in ungrouped_nodes:
|
||||||
|
Selection.remove(node)
|
||||||
|
|
||||||
## Add an output device that can be written to.
|
## Add an output device that can be written to.
|
||||||
#
|
#
|
||||||
|
@ -18,6 +18,8 @@ Item {
|
|||||||
property alias deleteObject: deleteObjectAction;
|
property alias deleteObject: deleteObjectAction;
|
||||||
property alias centerObject: centerObjectAction;
|
property alias centerObject: centerObjectAction;
|
||||||
property alias groupObjects: groupObjectsAction;
|
property alias groupObjects: groupObjectsAction;
|
||||||
|
property alias unGroupObjects:unGroupObjectsAction;
|
||||||
|
|
||||||
property alias multiplyObject: multiplyObjectAction;
|
property alias multiplyObject: multiplyObjectAction;
|
||||||
property alias splitObject: splitObjectAction;
|
property alias splitObject: splitObjectAction;
|
||||||
|
|
||||||
@ -130,6 +132,13 @@ Item {
|
|||||||
enabled: UM.Scene.numObjectsSelected > 1 ? true: false
|
enabled: UM.Scene.numObjectsSelected > 1 ? true: false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Action
|
||||||
|
{
|
||||||
|
id: unGroupObjectsAction
|
||||||
|
text: qsTr("Ungroup objects");
|
||||||
|
enabled: UM.Scene.isGroupSelected
|
||||||
|
}
|
||||||
|
|
||||||
Action {
|
Action {
|
||||||
id: multiplyObjectAction;
|
id: multiplyObjectAction;
|
||||||
//: Duplicate object action
|
//: Duplicate object action
|
||||||
|
@ -353,6 +353,11 @@ UM.MainWindow {
|
|||||||
Printer.groupSelected()
|
Printer.groupSelected()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unGroupObjects.onTriggered:
|
||||||
|
{
|
||||||
|
Printer.ungroupSelected()
|
||||||
|
}
|
||||||
|
|
||||||
deleteAll.onTriggered: Printer.deleteAll()
|
deleteAll.onTriggered: Printer.deleteAll()
|
||||||
resetAllTranslation.onTriggered: Printer.resetAllTranslation()
|
resetAllTranslation.onTriggered: Printer.resetAllTranslation()
|
||||||
resetAll.onTriggered: Printer.resetAll()
|
resetAll.onTriggered: Printer.resetAll()
|
||||||
@ -379,6 +384,7 @@ UM.MainWindow {
|
|||||||
MenuItem { action: actions.multiplyObject; }
|
MenuItem { action: actions.multiplyObject; }
|
||||||
MenuItem { action: actions.splitObject; }
|
MenuItem { action: actions.splitObject; }
|
||||||
MenuItem { action: actions.groupObjects;}
|
MenuItem { action: actions.groupObjects;}
|
||||||
|
MenuItem { action: actions.unGroupObjects;}
|
||||||
MenuSeparator { }
|
MenuSeparator { }
|
||||||
MenuItem { action: actions.deleteAll; }
|
MenuItem { action: actions.deleteAll; }
|
||||||
MenuItem { action: actions.reloadAll; }
|
MenuItem { action: actions.reloadAll; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user