本文整理匯總了Python中UM.Operations.RemoveSceneNodeOperation.RemoveSceneNodeOperation.addOperation方法的典型用法代碼示例。如果您正苦於以下問題:Python RemoveSceneNodeOperation.addOperation方法的具體用法?Python RemoveSceneNodeOperation.addOperation怎麽用?Python RemoveSceneNodeOperation.addOperation使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類UM.Operations.RemoveSceneNodeOperation.RemoveSceneNodeOperation
的用法示例。
在下文中一共展示了RemoveSceneNodeOperation.addOperation方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: deleteObject
# 需要導入模塊: from UM.Operations.RemoveSceneNodeOperation import RemoveSceneNodeOperation [as 別名]
# 或者: from UM.Operations.RemoveSceneNodeOperation.RemoveSceneNodeOperation import addOperation [as 別名]
def deleteObject(self, object_id):
if not self.getController().getToolsEnabled():
return
node = self.getController().getScene().findObject(object_id)
if not node and object_id != 0: # Workaround for tool handles overlapping the selected object
node = Selection.getSelectedObject(0)
if node:
group_node = None
if node.getParent():
group_node = node.getParent()
op = RemoveSceneNodeOperation(node)
op.push()
if group_node:
if len(group_node.getChildren()) == 1 and group_node.callDecoration("isGroup"):
op.addOperation(SetParentOperation(group_node.getChildren()[0], group_node.getParent()))
op = RemoveSceneNodeOperation(group_node)
op.push()