vrdNode

class vrdNode

(Inherits vrdSceneObject)

This is the base class for all nodes.

A node instance gives access to all properties of a node such as its parent and its list of direct children. There are no functions however to modify the node’s hierarchy directly.

Hierarchy modifications have to be made by interacting with the vrdNodeList instance obtained here children.

Functions

vrdNode.applyMaterial(material)

Sets the material for this node.

Parameters:material (vrdMaterial) – The new material
vrdNode.getBoundingBox()

Returns the local bounding box of the node including its children.

Returns:Bounding box of node
Return type:vrdBoundingBox
vrdNode.getChild(index)

Gets a child node by index.

Parameters:index (integer) – The index of the child node. The valid range is from 0 to vrdNode.getChildCount() - 1.
Returns:The child node.
Return type:vrdNode
vrdNode.getChildCount()

Get the number of child nodes.

Returns:The number of children.
Return type:integer
vrdNode.getChildIndex(child)

Get the index of the child node in the list of children.

Parameters:child (vrdNode) – The child node.
Returns:The index of the child.
Return type:integer
vrdNode.getChildren()

Returns a list of all child nodes.

Note this is a copy of the node’s children list, changing the returned list does not change the children of the node.

To add or remove children from the node use the member children.
Returns:The list of child nodes.
Return type:List[vrdNode]
vrdNode.getChildrenRecursive()

Returns a list of all child nodes recursively (including children of children).

Returns:The list of child nodes.
Return type:List[vrdNode]
vrdNode.getIcon()

Gets the icon of the node.

Returns:The icon of the node.
Return type:QIcon
vrdNode.getMaterial()

Gets the material for this node.

Returns:The material for this node, or an invalid material if no material was found
Return type:vrdMaterial
vrdNode.getName()

Returns the name of the node.

Returns:The name of the node.
Return type:string
vrdNode.getOrCreateTransformNode()

Get a transformation node for this node. Create one if necessary.

Returns:A transformable node
Return type:vrdNode
vrdNode.getParent()

Returns the parent node.

Returns:The parent node.
Return type:vrdNode
vrdNode.getPath()

Returns the path of the node.

Returns:The path of the node.
Return type:string
vrdNode.getSelectableFlag()
Returns:Gets the local selectable flag. True, node is selectable in the render window
Return type:bool
vrdNode.getSharedNodes()

Returns the nodes in the scene graph that share this node. The list does not include the node the method is called for. For cameras vrdCameraNode.getModuleNode() can be used to get the corresponding camera graph node. For lights vrdBaseLightNode.getModuleNode() can be used to get the corresponding light graph node.

Returns:A list of nodes
Return type:List[vrdNode]
vrdNode.getSynchronizedNodes()

Returns scene nodes that are synchronized with this node.

Synchronized nodes share and synchronize their children but the node properties of the synchronized nodes are independent. Synchronized transform nodes are called Transformable Clones or Transformable Clone Roots in the GUI.

Returns:A list of nodes
Return type:List[vrdNode]
vrdNode.getUniquePath()

Returns the unique path of the node.

Returns:The unique path of the node.
Return type:string
vrdNode.getVisibilityFlag()

Returns the local visibility flag.

The local visibility flag indicates the visibility state of the node. It does not consider the visibility state of the parent node. For that case, use vrdNode.isVisible().

Returns:True if the visibility flag is set, False otherwise.
Return type:bool
vrdNode.getWorldBoundingBox()

Returns the world bounding box of the node including its children.

Example of combining multiple bounding boxes:

def getWorldCenter(nodes):
    bb = vrdBoundingBox()
    for node in nodes:
        bb.extendBy(node.getWorldBoundingBox())
    return bb.getCenter()

# Find all nodes whose name starts with "Box".
nodes = vrNodeService.findNodes("Box*", True)
# Calculate the bounding box center of these nodes
center = getWorldCenter(nodes)
# Print the result
print(center)
Returns:World bounding box of node
Return type:vrdBoundingBox
vrdNode.getWorldTransform()

Gets the world transformation matrix of this node.

Returns:The 4x4 world transformation matrix
Return type:QMatrix4x4
vrdNode.hasParent(parent)

Traverses up the tree from this node to root to find given parent node. To check only direct parent, use vrdNode.getParent() == parent instead.

Parameters:parent (vrdNode) – The parent node to find. Must be a valid node.
Returns:True if found.
Return type:bool
vrdNode.isGroup()

Returns whether the node is a group node.

Returns:True if the node is a group, False otherwise.
Return type:bool
vrdNode.isImplicitShared()

An implicit shared node is only shared because it is part of a shared graph. In the scenegraph view it is dotted underlined. A node that is shared but not implicit shared is solid underlined.

Returns:True, if all parents of shared instances are clones of each other
Return type:bool
vrdNode.isShared()

Returns true, if this node has shared instances in the scene. Shared instances are also called clones or cloned nodes. Shared nodes have the same properties, e.g. same geometry or same transformation, and also the same children.

Returns:True, if the node is shared.
Return type:bool
vrdNode.isSharedWith(node)

Returns if the given node is a shared instance of this node.

Parameters:node (vrdNode) – Node to check
Returns:True, if given node is a shared instance of this node.
Return type:bool
vrdNode.isSynchronized()

Returns true, if this node shares its children with other nodes. See vrdNode.getSynchronizedNodes().

Returns:true if the node is synchronized
Return type:bool
vrdNode.isSynchronizedWith(node)

Returns if this node shares its children with the given node. See vrdNode.getSynchronizedNodes().

Parameters:node (vrdNode) – Node to check
Returns:True if the node is synchronized with the given node
Return type:bool
vrdNode.isVisible()

Returns if the node is visible.

Returns true if the node is visible, i.e. if the node itself and all parents are visible.

Returns:True if visible, False otherwise.
Return type:bool
vrdNode.setName(name)

Sets the name of the node.

Parameters:name (string) – The new name of the node.
vrdNode.setSelectableFlag(selectable)

Sets the local selectable flag.

Parameters:selectable (bool) – True if the node should be selectable in the render window
vrdNode.setVisibilityFlag(visible)

Sets the local visibility flag.

This flag enables / disables rendering of the node.

Parameters:visible (bool) – True if the node should be visible, otherwise false.

Instance Variables

children: vrdNodeList

Access to the children of this node. All changes made to this list object will immediately be executed on the node.