本文整理匯總了Python中UM.Operations.RemoveSceneNodeOperation.RemoveSceneNodeOperation類的典型用法代碼示例。如果您正苦於以下問題:Python RemoveSceneNodeOperation類的具體用法?Python RemoveSceneNodeOperation怎麽用?Python RemoveSceneNodeOperation使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了RemoveSceneNodeOperation類的7個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: deleteObject
def deleteObject(self, object_id):
object = self.getController().getScene().findObject(object_id)
if not object and object_id != 0: #Workaround for tool handles overlapping the selected object
object = Selection.getSelectedObject(0)
if object:
op = RemoveSceneNodeOperation(object)
op.push()
示例2: _removeEraserMesh
def _removeEraserMesh(self, node: CuraSceneNode):
parent = node.getParent()
if parent == self._controller.getScene().getRoot():
parent = None
op = RemoveSceneNodeOperation(node)
op.push()
if parent and not Selection.isSelected(parent):
Selection.add(parent)
CuraApplication.getInstance().getController().getScene().sceneChanged.emit(node)
示例3: deleteObject
def deleteObject(self, object_id):
object = self.getController().getScene().findObject(object_id)
if not object and object_id != 0: #Workaround for tool handles overlapping the selected object
object = Selection.getSelectedObject(0)
if object:
if object.getParent():
group_node = object.getParent()
if not group_node.callDecoration("isGroup"):
op = RemoveSceneNodeOperation(object)
else:
while group_node.getParent().callDecoration("isGroup"):
group_node = group_node.getParent()
op = RemoveSceneNodeOperation(group_node)
op.push()
示例4: deleteObject
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:
if node.getParent():
group_node = node.getParent()
if not group_node.callDecoration("isGroup"):
op = RemoveSceneNodeOperation(node)
else:
while group_node.getParent().callDecoration("isGroup"):
group_node = group_node.getParent()
op = RemoveSceneNodeOperation(group_node)
op.push()
示例5: deleteObject
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()
示例6: removeMesh
def removeMesh(self, key):
for node in Application.getInstance().getController().getScene().getRoot().getAllChildren():
if id(node) == key:
op = RemoveSceneNodeOperation(node)
op.push()
break
示例7: deleteObject
def deleteObject(self, object_id):
object = self.getController().getScene().findObject(object_id)
if object:
op = RemoveSceneNodeOperation(object)
op.push()