本文整理汇总了Python中UM.Operations.AddSceneNodeOperation.AddSceneNodeOperation类的典型用法代码示例。如果您正苦于以下问题:Python AddSceneNodeOperation类的具体用法?Python AddSceneNodeOperation怎么用?Python AddSceneNodeOperation使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了AddSceneNodeOperation类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _onFileLoaded
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()
示例2: _readMeshFinished
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)
示例3: _readMeshFinished
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)
示例4: _onFileLoaded
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.
示例5: test_SimpleRedoUndo
def test_SimpleRedoUndo():
node = SceneNode()
parent_node = SceneNode()
operation = AddSceneNodeOperation(node, parent_node)
operation.redo()
assert node.getParent() == parent_node
operation.undo()
assert node.getParent() is None
示例6: test_UndoRedoWithSelection
def test_UndoRedoWithSelection():
node = SceneNode()
parent_node = SceneNode()
Selection.add(node)
operation = AddSceneNodeOperation(node, parent_node)
operation.undo()
assert not Selection.isSelected(node)
operation.redo()
assert Selection.isSelected(node)
示例7: _readWorkspaceFinished
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)
示例8: _readMeshFinished
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)