vrScenegraphService¶
-
class
vrScenegraphService
¶
(Inherits vrBaseService
)
Interface to access the scenegraph in VRED.
Functions that create new nodes add the new nodes to the graph.
Summary¶
- Functions:
- checkAllowance(node, actions) → List[bool]
- clearSelection()
- cloneNodes(nodes) → List[vrdNode]
- cloneNodesMirrorAxis(nodes, axis) → List[vrdNode]
- convertNode(node, type) → vrdNode
- convertToMesh(nodes)
- copyAnimations(node)
- copyNodes(nodes)
- copyTransformations(nodes)
- copyTransformVariants(node)
- copyUVs(node)
- createNode(type, parent, name, forceUniqueName) → vrdNode
- createShellFromSurfaces(nodes) → vrdNode
- createSwitchFromNodes(nodes, parent, index) → vrdNode
- createVolume(volumeType, parent) → vrdNode
- cutNodes(nodes)
- deleteNodes(nodes, keepChildren)
- duplicateNodes(nodes, option) → List[vrdNode]
- duplicateNodesMirrorAxis(nodes, flushTransform, axis) → List[vrdNode]
- getAllNodes(root, options) → List[vrdNode]
- getEnvironmentGeometrySwitch() → vrdSwitchNode
- getInternalRootNode() → vrdNode
- getLastHiddenNodes() → List[vrdNode]
- getLiveSearchEnabled() → bool
- getMirroredNodes(node) → List[vrdNode]
- getNodeInfo(nodes) → vrdNodeInfo
- getNodesInClipboard() → List[vrdNode]
- getNodesWithAllTags(tags, root) → List[vrdNode]
- getNodesWithAnyTag(tags, root) → List[vrdNode]
- getRootNode() → vrdNode
- getSelectedNode() → vrdNode
- getSelectedNodes() → List[vrdNode]
- getSelectedRootNodes(sorted) → List[vrdNode]
- getSelectedSubtreeNodes() → List[vrdNode]
- getShowComponents() → bool
- getSuperRootNode() → vrdNode
- getSyncShowHide() → bool
- getTransformableCloneRootEnabled() → bool
- getTransformRootNode() → vrdNode
- getTreeInfo() → List[integer]
- getTreeItemInfo(node) → vrdSceneItemInfo
- getTreeItemInfoFlags(node) → vrdSceneItemInfo.Flags
- groupByMaterial()
- groupNodes(nodes) → vrdNode
- growComponentSelection(componentNodes)
- hasLastHiddenNodes() → bool
- invertGeometrySelection()
- invertGeometrySelectionInGroup(geometryNodes)
- isAllowed(node, action) → bool
- isIsolateViewActive(renderWindowIndex) → bool
- isSceneEmpty() → bool
- loadAnimationsToNodes(fileName, nodes)
- pasteAnimations(nodes, pasteAsClone)
- pasteNodes(targetNodes, keepWorldTransformation, pasteAsClone)
- pasteTransformation(targetNodes, translation, rotation, scale, rotationPivot, scalePivot)
- pasteTransformationAsVariant(targetNodes)
- pasteTransformVariants(nodes)
- pasteUVs(nodes)
- resetIsolateView(renderWindowIndex)
- selectAllClones(nodes)
- selectAllInSameHierarchyLevel(node)
- selectAllTransformableClones(nodes)
- selectAllWithMaterials(materials)
- selectCommonParent(nodes)
- selectTopLevel()
- setIsolateView(nodes, renderWindowIndex)
- setLiveSearchEnabled(value)
- setNodeVisibility(nodes, visible, recursive)
- setSelection(nodes)
- setShowComponents(value)
- setSwitchChoiceByAllTags(switchNode, tags) → bool
- setSwitchChoiceByAnyTag(switchNode, tags) → bool
- setSyncShowHide(value)
- setTransformableCloneRootEnabled(value)
- shrinkComponentSelection(componentNodes)
- Signals:
Functions¶
-
vrScenegraphService.
checkAllowance
(node, actions)¶ Check if operations are allowed on a given node.
Parameters: - node (vrdNode) – The node to check
- actions (List[vrScenegraphTypes.Action]) – A list of actions
Returns: A list with the result for each action
Return type: List[bool]
-
vrScenegraphService.
clearSelection
()¶ Sets an empty selection.
-
vrScenegraphService.
cloneNodes
(nodes)¶ Clones the given nodes.
Parameters: nodes (List[vrdNode]) – The nodes to be cloned Returns: The cloned nodes. They are located at the parents of the input nodes. Return type: List[vrdNode]
-
vrScenegraphService.
cloneNodesMirrorAxis
(nodes, axis)¶ Clones the given nodes and mirrors them at the given axis.
Parameters: - nodes (List[vrdNode]) – The nodes to be cloned
- axis (vrScenegraphTypes.MirrorMode) – The mirror axis
Returns: The cloned nodes. They are located at the parents of the input nodes.
Return type: List[vrdNode]
-
vrScenegraphService.
convertNode
(node, type)¶ Tries to convert the given node into another type.
Parameters: - node (vrdNode) – The node to be converted
- type (vrScenegraphTypes.NodeType) – The target type
Returns: The converted node
Return type:
-
vrScenegraphService.
convertToMesh
(nodes)¶ Removes all NURBS and converts shell and surfaces nodes to meshes.
Parameters: nodes (List[vrdNode]) – The root nodes of the graphs to be processed. Shells and surfaces in the graphs are converted.
-
vrScenegraphService.
copyAnimations
(node)¶ Copy all animations in the given node into the clipboard.
Parameters: node (vrdNode) – The node to be copied
-
vrScenegraphService.
copyNodes
(nodes)¶ Copy the given nodes into the clipboard.
Parameters: nodes (List[vrdNode]) – The nodes to be copied
-
vrScenegraphService.
copyTransformations
(nodes)¶ Copy the transformation of the given nodes into the clipboard.
Parameters: nodes (List[vrdNode]) – The nodes to be copied
-
vrScenegraphService.
copyTransformVariants
(node)¶ Copy all transform variants in the given nodes into the clipboard.
Parameters: node (vrdNode) – The node to be copied
-
vrScenegraphService.
copyUVs
(node)¶ Copy all UVs in the given nodes into the clipboard.
Parameters: node (vrdNode) – The node to be copied
-
vrScenegraphService.
createNode
(type, parent=vrdNode(), name='', forceUniqueName=True)¶ Creates a new node with the given type.
Parameters: - type (vrScenegraphTypes.NodeType) – The node type
- parent (vrdNode) – The parent node of the newly created node. By default the scenegraph root is used.
- name (string) – A name for the new node. If empty, name is created from type.
- forceUniqueName (bool) – Forces the name of the new node to be unique
Returns: The new node
Return type:
-
vrScenegraphService.
createShellFromSurfaces
(nodes)¶ Creates a new shell from the given surfaces.
Parameters: nodes (List[vrdNode]) – The surfaces to be combined Returns: The created shell. It is located at the common parent Return type: vrdNode
-
vrScenegraphService.
createSwitchFromNodes
(nodes, parent, index)¶ Creates a new switch from the given nodes.
Parameters: Returns: The created switch.
Return type:
-
vrScenegraphService.
createVolume
(volumeType, parent=vrdNode())¶ Creates a new volume.
Parameters: - volumeType (vrScenegraphTypes.VolumeType) – The desired type of the new volume.
- parent (vrdNode) – The node under which the new volume node should be located.
Returns: The newly created volume node with the respective material assigned to it.
Return type:
-
vrScenegraphService.
cutNodes
(nodes)¶ Copy the given nodes into the clipboard and remove them from the scenegraph.
Parameters: nodes (List[vrdNode]) – The nodes to be removed
-
vrScenegraphService.
deleteNodes
(nodes, keepChildren=False)¶ Deletes the given nodes.
Parameters: - nodes (List[vrdNode]) – The nodes to be deleted
- keepChildren (bool) – If true, the children of the given nodes will not be removed
-
vrScenegraphService.
duplicateNodes
(nodes, option=vrScenegraphTypes.DuplicateKeepLocalClones)¶ Duplicates the given nodes.
Parameters: - nodes (List[vrdNode]) – The nodes to be duplicated
- option (vrScenegraphTypes.DuplicateOption) – Defines how to handle clones inside the duplicated tree
Returns: The duplicated nodes. They are located at the parents of the input nodes.
Return type: List[vrdNode]
-
vrScenegraphService.
duplicateNodesMirrorAxis
(nodes, flushTransform, axis)¶ Duplicates the given nodes and mirrors them at the given axis.
Parameters: - nodes (List[vrdNode]) – The nodes to be duplicated
- flushTransform (bool) – Flush Transformation
- axis (vrScenegraphTypes.MirrorMode) – The mirror axis
Returns: The duplicated nodes. They are located at the parents of the input nodes.
Return type: List[vrdNode]
-
vrScenegraphService.
getAllNodes
(root=vrdNode(), options=vrdFindOptions())¶ Get all nodes in the scene graph or in a given sub graph.
Parameters: - root (vrdNode) – The graph to search. If empty, the whole scene graph is searched
- options (vrdFindOptions) – Find options. By default, components are skipped
Returns: All nodes in the graph
Return type: List[vrdNode]
-
vrScenegraphService.
getEnvironmentGeometrySwitch
()¶ Get the default environment geometry switch.
Returns: The environment geometry switch Return type: vrdSwitchNode
-
vrScenegraphService.
getInternalRootNode
()¶ Returns: The internal root node of the scene. Return type: vrdNode
-
vrScenegraphService.
getLiveSearchEnabled
()¶ Returns: True, if live search is enabled Return type: bool
-
vrScenegraphService.
getMirroredNodes
(node=vrdNode())¶ Get all nodes having a mirror transformation.
Parameters: node (vrdNode) – The tree to be searched. By default search the whole scene graph Returns: A list of all mirrored nodes Return type: List[vrdNode]
-
vrScenegraphService.
getNodeInfo
(nodes)¶ Get statistical information for the given nodes.
Parameters: nodes (List[vrdNode]) – The nodes to be queried Returns: a vrdNodeInfo object containing the information Return type: vrdNodeInfo
-
vrScenegraphService.
getNodesInClipboard
()¶ Returns: The nodes that are in the clipboard. Return type: List[vrdNode]
-
vrScenegraphService.
getNodesWithAllTags
(tags, root=vrdNode())¶ Get the nodes that have all the given tags.
Parameters: - tags (List[string]) – The set of tags to search for.
- root (vrdNode) – The node which child tree is searched.
Returns: The list of nodes.
Return type: List[vrdNode]
-
vrScenegraphService.
getNodesWithAnyTag
(tags, root=vrdNode())¶ Get the nodes that have any of the given tags.
Parameters: - tags (List[string]) – The set of tags to search for.
- root (vrdNode) – The node which child tree is searched.
Returns: The list of nodes.
Return type: List[vrdNode]
-
vrScenegraphService.
getSelectedNode
()¶ Returns: Returns the last node in the list of selected nodes. This is the node that was selected most recently. Return type: vrdNode
-
vrScenegraphService.
getSelectedNodes
()¶ Returns: The currently selected nodes in the scene graph view. Return type: List[vrdNode]
-
vrScenegraphService.
getSelectedRootNodes
(sorted=True)¶ Parameters: sorted (bool) – If True, list is ordered by graph position. Returns: The currently selected nodes in the scene graph view. Children of selected nodes are ignored. Return type: List[vrdNode]
-
vrScenegraphService.
getSelectedSubtreeNodes
()¶ Returns: The currently selected nodes in the scene graph view ordered by graph position including all their child nodes. Return type: List[vrdNode]
-
vrScenegraphService.
getShowComponents
()¶ Returns: True, if shell components are shown in the scene graph view Return type: bool
-
vrScenegraphService.
getSuperRootNode
()¶ Returns: The super root node of the scene. Return type: vrdNode
-
vrScenegraphService.
getSyncShowHide
()¶ Returns: True, if synchronize show and hide state for shared nodes is enabled Return type: bool
-
vrScenegraphService.
getTransformableCloneRootEnabled
()¶ See vrScenegraphService.setTransformableCloneRootEnabled(value) for a description of this option.
Returns: True if clone functions should create transformable clone roots. Return type: bool
-
vrScenegraphService.
getTransformRootNode
()¶ Returns: The transform root node of the scene. Return type: vrdNode
-
vrScenegraphService.
getTreeInfo
()¶ Get encoded scenegraph structure.
The following information is stored for each node in a list. nodeId, parentId, parentIndex, childCount, children
Returns: An object containing additional node information Return type: List[integer]
-
vrScenegraphService.
getTreeItemInfo
(node)¶ Get detailed node information used in the scenegraph tree view.
Parameters: node (vrdNode) – The node, information is requested for Returns: An object containing additional node information Return type: vrdSceneItemInfo
-
vrScenegraphService.
getTreeItemInfoFlags
(node)¶ Get node feature information used in the scenegraph tree view.
Parameters: node (vrdNode) – The node, information is requested for Returns: A bitvector with features used by the given node Return type: vrdSceneItemInfo.Flags
-
vrScenegraphService.
groupByMaterial
()¶ Groups the whole scene graph by materials.
-
vrScenegraphService.
groupNodes
(nodes)¶ Places all given nodes into a new group.
Parameters: nodes (List[vrdNode]) – The nodes to be grouped Returns: The new group. It is located at the common parent Return type: vrdNode
-
vrScenegraphService.
growComponentSelection
(componentNodes)¶ Selects the given components as well as their nearest adjacent components.
Parameters: componentNodes (List[vrdNode]) – A list of vrdNode objects.
-
vrScenegraphService.
hasLastHiddenNodes
()¶ Returns: True, if there are nodes in the last hidden nodes list. Return type: bool
-
vrScenegraphService.
invertGeometrySelection
()¶ Inverts selection on geometry nodes.
-
vrScenegraphService.
invertGeometrySelectionInGroup
(geometryNodes)¶ Inverts selection on geometry nodes only within their containing group and subgroups.
Parameters: geometryNodes (List[vrdNode]) – A list of vrdNode objects.
-
vrScenegraphService.
isAllowed
(node, action)¶ Check if an operation is allowed on the given node.
Parameters: - node (vrdNode) – The node to check
- action (vrScenegraphTypes.Action) – The action to check
Returns: True, if action is allowed
Return type: bool
-
vrScenegraphService.
isIsolateViewActive
(renderWindowIndex=- 1)¶ Check, if isolate view is active.
Parameters: renderWindowIndex (integer) – If -1 is given, the current window is used Returns: True, if isolate view is active Return type: bool
-
vrScenegraphService.
isSceneEmpty
()¶ Gets if the scene is empty.
Returns: True if there are no other nodes in the scene than the default ones. Return type: bool
-
vrScenegraphService.
loadAnimationsToNodes
(fileName, nodes)¶ Load animations from file and add them to the given nodes.
Parameters: - fileName (string) – The animation file to load
- nodes (List[vrdNode]) – Animations will be added to this nodes
-
vrScenegraphService.
pasteAnimations
(nodes, pasteAsClone=False)¶ Paste copied animations into the given nodes.
Parameters: - nodes (List[vrdNode]) – Target for the paste operation
- pasteAsClone (bool) – If true, animation will be cloned
-
vrScenegraphService.
pasteNodes
(targetNodes, keepWorldTransformation=False, pasteAsClone=False)¶ Paste copied nodes into the given nodes.
Parameters: - targetNodes (List[vrdNode]) – Target for the paste operation
- keepWorldTransformation (bool) – If True, keep original world transformation
- pasteAsClone (bool) – If True, paste as clone. Otherwise paste as copy
-
vrScenegraphService.
pasteTransformation
(targetNodes, translation=True, rotation=True, scale=True, rotationPivot=True, scalePivot=True)¶ Paste copied transformations into the given nodes.
Parameters: - targetNodes (List[vrdNode]) – Target for the paste operation
- translation (bool) – If True, copy translation
- rotation (bool) – If True, copy rotation
- scale (bool) – If True, copy scale
- rotationPivot (bool) – If True, copy rotation pivot
- scalePivot (bool) – If True, copy scale pivot
-
vrScenegraphService.
pasteTransformationAsVariant
(targetNodes)¶ Paste copied transformations as variants into the given nodes.
Parameters: targetNodes (List[vrdNode]) – Target for the paste operation
-
vrScenegraphService.
pasteTransformVariants
(nodes)¶ Paste copied transform variants into the given nodes.
Parameters: nodes (List[vrdNode]) – Target for the paste operation
-
vrScenegraphService.
pasteUVs
(nodes)¶ Paste copied UVs into the given nodes.
Parameters: nodes (List[vrdNode]) – Target for the paste operation
-
vrScenegraphService.
resetIsolateView
(renderWindowIndex=- 1)¶ Clear isolate view.
Parameters: renderWindowIndex (integer) – If -1 is given, the current window is used
-
vrScenegraphService.
selectAllClones
(nodes)¶ Selects all clones of given nodes.
Parameters: nodes (List[vrdNode]) – A list of vrdNode objects.
-
vrScenegraphService.
selectAllInSameHierarchyLevel
(node)¶ Selects all nodes in the same level as given node.
Parameters: node (vrdNode) – A vrdNode object.
-
vrScenegraphService.
selectAllTransformableClones
(nodes)¶ Selects all transformable clones of given nodes.
Parameters: nodes (List[vrdNode]) – A list of vrdNode objects.
-
vrScenegraphService.
selectAllWithMaterials
(materials)¶ Selects all nodes which have any of the given materials applied to them.
Parameters: materials (List[vrdMaterial]) – A list of vrdMaterial objects.
-
vrScenegraphService.
selectCommonParent
(nodes)¶ Selects the first common parent of given nodes.
Parameters: nodes (List[vrdNode]) – A list of vrdNode objects.
-
vrScenegraphService.
selectTopLevel
()¶ Selects all top-level nodes below root node.
-
vrScenegraphService.
setIsolateView
(nodes, renderWindowIndex=- 1)¶ Only show the given nodes.
Parameters: - nodes (List[vrdNode]) – A list of nodes be isolated
- renderWindowIndex (integer) – If -1 is given, the current window is used
-
vrScenegraphService.
setLiveSearchEnabled
(value)¶ Enables or disables live search.
Parameters: value (bool) – If True, enable live search
-
vrScenegraphService.
setNodeVisibility
(nodes, visible, recursive=False)¶ Changes the visibility for the given list of nodes.
Parameters: - nodes (List[vrdNode]) – A list of nodes
- visible (bool) – If True, node will be visible, otherwise hidden
- recursive (bool) – If True, apply all changes to each child
-
vrScenegraphService.
setSelection
(nodes)¶ Changes the node selection.
Parameters: nodes (List[vrdNode]) – A list of vrdNode objects
-
vrScenegraphService.
setShowComponents
(value)¶ Show or hide shell components in the scene graph view.
Parameters: value (bool) – If True, show components
-
vrScenegraphService.
setSwitchChoiceByAllTags
(switchNode, tags)¶ Sets the choice of a switch node to the first child with all of the given tags. If not found the choice stays unchanged.
Parameters: - switchNode (vrdSwitchNode) – The switch node to modify.
- tags (List[string]) – The set of tags determining the child node to select.
Returns: True if matching child node found
Return type: bool
-
vrScenegraphService.
setSwitchChoiceByAnyTag
(switchNode, tags)¶ Sets the choice of a switch node to the first child with any of the given tags. If not found the choice stays unchanged.
Parameters: - switchNode (vrdSwitchNode) – The switch node to modify.
- tags (List[string]) – The set of tags determining the child node to select.
Returns: True if matching child node found
Return type: bool
-
vrScenegraphService.
setSyncShowHide
(value)¶ Enables synchronization of visibility when using show and hide on shared nodes.
Parameters: value (bool) – If True, synchronize show, hide state for shared nodes
-
vrScenegraphService.
setTransformableCloneRootEnabled
(value)¶ This option controls the outcome of functions that create cloned nodes, e.g. cloneNodes and cloneNodeMirrorAxis, for input root nodes that are transform nodes.
If enabled, the clone root of an input transform root node is created as a transformable clone root. That means the input root and the clone root will be independently transformable but their children will be shared and synchronized.
If disabled, the clone root of an input transform root node is created as a regular clone, i.e. the transformation is shared and all their children are shared and synchronized.
Parameters: value (bool) – True to create transformable clone roots when using clone functions. False to create clone roots with shared transformation.
Signals¶
-
vrScenegraphService.
editSelected
()¶ This signal is emitted, to open the node name editor.
-
vrScenegraphService.
isolateViewChanged
(renderWindowIndex=- 1)¶ This signal is emitted, whenever isolate view changes.
Parameters: renderWindowIndex (integer) –
-
vrScenegraphService.
nodeIdChanged
(oldId, newId)¶ Called, if the id of a node has changed. E.g. on unshare node.
Parameters: - oldId (List[integer]) –
- newId (List[integer]) –
-
vrScenegraphService.
scenegraphChanged
(changes=vrScenegraphTypes.AllChanged)¶ This signal is emitted, whenever the scenegraph changes.
Parameters: changes (vrScenegraphTypes.ChangeFlag) –
-
vrScenegraphService.
scrollToNode
(node)¶ This signal is emitted, to scroll to the given node.
Parameters: node (vrdNode) – The node to scroll to
-
vrScenegraphService.
scrollToSelected
()¶ This signal is emitted, to scroll to the first selected node.