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


Python AddSceneNodeOperation.push方法代碼示例

本文整理匯總了Python中UM.Operations.AddSceneNodeOperation.AddSceneNodeOperation.push方法的典型用法代碼示例。如果您正苦於以下問題:Python AddSceneNodeOperation.push方法的具體用法?Python AddSceneNodeOperation.push怎麽用?Python AddSceneNodeOperation.push使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在UM.Operations.AddSceneNodeOperation.AddSceneNodeOperation的用法示例。


在下文中一共展示了AddSceneNodeOperation.push方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: _onFileLoaded

# 需要導入模塊: from UM.Operations.AddSceneNodeOperation import AddSceneNodeOperation [as 別名]
# 或者: from UM.Operations.AddSceneNodeOperation.AddSceneNodeOperation import push [as 別名]
    def _onFileLoaded(self, job):
        node = job.getResult()
        if node != None:
            node.setSelectable(True)
            node.setName(os.path.basename(job.getFileName()))

            op = AddSceneNodeOperation(node, self.getController().getScene().getRoot())
            op.push()
開發者ID:kelvinfang,項目名稱:Cura,代碼行數:10,代碼來源:CuraApplication.py

示例2: _readMeshFinished

# 需要導入模塊: from UM.Operations.AddSceneNodeOperation import AddSceneNodeOperation [as 別名]
# 或者: from UM.Operations.AddSceneNodeOperation.AddSceneNodeOperation import push [as 別名]
    def _readMeshFinished(self, job):
        node = job.getResult()
        if node != None:  
            node.setSelectable(True)
            node.setName(os.path.basename(job.getFileName()))

            op = AddSceneNodeOperation(node, self._scene.getRoot())
            op.push()

            self._scene.sceneChanged.emit(node)
開發者ID:Kiddo3D,項目名稱:Uranium,代碼行數:12,代碼來源:MeshFileHandlerProxy.py

示例3: _readMeshFinished

# 需要導入模塊: from UM.Operations.AddSceneNodeOperation import AddSceneNodeOperation [as 別名]
# 或者: from UM.Operations.AddSceneNodeOperation.AddSceneNodeOperation import push [as 別名]
 def _readMeshFinished(self, job):
     nodes = job.getResult()
     for node in nodes:
         node.setSelectable(True)
         node.setName(os.path.basename(job.getFileName()))
         # We need to prevent circular dependency, so do some just in time importing.
         from UM.Operations.AddSceneNodeOperation import AddSceneNodeOperation
         op = AddSceneNodeOperation(node, self._application.getController().getScene().getRoot())
         op.push()
         self._application.getController().getScene().sceneChanged.emit(node)
開發者ID:Ultimaker,項目名稱:Uranium,代碼行數:12,代碼來源:MeshFileHandler.py

示例4: _onFileLoaded

# 需要導入模塊: from UM.Operations.AddSceneNodeOperation import AddSceneNodeOperation [as 別名]
# 或者: from UM.Operations.AddSceneNodeOperation.AddSceneNodeOperation import push [as 別名]
    def _onFileLoaded(self, job):
        node = job.getResult()
        if node != None:
            self.setJobName(os.path.basename(job.getFileName()))
            node.setSelectable(True)
            node.setName(os.path.basename(job.getFileName()))
            op = AddSceneNodeOperation(node, self.getController().getScene().getRoot())
            op.push()

            self.getController().getScene().sceneChanged.emit(node) #Force scene change.
開發者ID:hippich,項目名稱:Cura,代碼行數:12,代碼來源:CuraApplication.py

示例5: _readWorkspaceFinished

# 需要導入模塊: from UM.Operations.AddSceneNodeOperation import AddSceneNodeOperation [as 別名]
# 或者: from UM.Operations.AddSceneNodeOperation.AddSceneNodeOperation import push [as 別名]
    def _readWorkspaceFinished(self, job):
        # Add the loaded nodes to the scene.
        nodes = job.getResult()
        if nodes is not None:  # Job was not a failure.
            # Delete all old nodes.
            self._application.deleteAll()

            # Add the loaded nodes to the scene.
            nodes = job.getResult()
            for node in nodes:
                # We need to prevent circular dependency, so do some just in time importing.
                from UM.Operations.AddSceneNodeOperation import AddSceneNodeOperation
                op = AddSceneNodeOperation(node, self._application.getController().getScene().getRoot())
                op.push()
                self._application.getController().getScene().sceneChanged.emit(node)
開發者ID:senttech,項目名稱:Uranium,代碼行數:17,代碼來源:WorkspaceFileHandler.py

示例6: _readMeshFinished

# 需要導入模塊: from UM.Operations.AddSceneNodeOperation import AddSceneNodeOperation [as 別名]
# 或者: from UM.Operations.AddSceneNodeOperation.AddSceneNodeOperation import push [as 別名]
    def _readMeshFinished(self, job):
        mesh = job.getResult()
        if mesh != None:
            if mesh.getType() is MeshType.pointcloud:  #Depending on the type we need a different node (as pointclouds are rendered differently)
                node = PointCloudNode()
            else:
                node = SceneNode()

            node.setSelectable(True)
            node.setMeshData(mesh)
            node.setName(os.path.basename(job.getFileName()))

            op = AddSceneNodeOperation(node, self._scene.getRoot())
            op.push()

            self._scene.sceneChanged.emit(node)
開發者ID:derekhe,項目名稱:Uranium,代碼行數:18,代碼來源:MeshFileHandlerProxy.py


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