當前位置: 首頁>>代碼示例>>Python>>正文


Python RemoveSceneNodeOperation.RemoveSceneNodeOperation類代碼示例

本文整理匯總了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()
開發者ID:CoretechR,項目名稱:Cura,代碼行數:9,代碼來源:CuraApplication.py

示例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)
開發者ID:Ultimaker,項目名稱:Cura,代碼行數:12,代碼來源:SupportEraser.py

示例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()
開發者ID:kelvinfang,項目名稱:Cura,代碼行數:16,代碼來源:CuraApplication.py

示例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()
開發者ID:XistorLogic,項目名稱:Cura,代碼行數:19,代碼來源:CuraApplication.py

示例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()
開發者ID:Cycloneee,項目名稱:Cura,代碼行數:21,代碼來源:CuraApplication.py

示例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
開發者ID:derekhe,項目名稱:Uranium,代碼行數:6,代碼來源:MeshListModel.py

示例7: deleteObject

    def deleteObject(self, object_id):
        object = self.getController().getScene().findObject(object_id)

        if object:
            op = RemoveSceneNodeOperation(object)
            op.push()
開發者ID:lotuspaperboy,項目名稱:Cura,代碼行數:6,代碼來源:CuraApplication.py


注:本文中的UM.Operations.RemoveSceneNodeOperation.RemoveSceneNodeOperation類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。