Lua API

Functions and types available to Lua plugins and the Visionary Render events system / script console.

Classes

Documentation helper for multi-return functions. Example usage: pos, rot, scale = vrNodeDecomposeTransform(node)


A box.


A matrix.


A matrix.


A node in the tree.


A plane.


A quaternion.


A ray.


A sphere.


A vector.


A vector.


A vector.


Functions


void getGradientColourAt(vrnode gradientNode,
number value
)

Gets the gradient colour (as RGB value) at the specified position.


Construct an axis aligned bounding box.

Parameters
min

The minimum value of the bounding box.

max

The maximum value of the bounding box.

Returns

A new box enclosing the min/max points


number vrAABoxExtent(vrbox box)

Returns the largest dimension of an axis aligned bounding box.


Returns an axis aligned bounding box that contains two other bounding boxes.


Construct an axis aligned bounding box, using a position and a size.

Parameters
pos

The position of the bounding box.

size

The size of the bounding box.

Returns

A new box enclosing the pos/size points


vrbox vrAABoxTransform(Any box,
vrmatrix4 matrix
)

Returns an axis aligned bounding box transformed by a matrix.


void vrAbortScript(string name)

Aborts a suspended script.

Parameters
name

The name of the script (reported by vrListSleepingScripts)


void vrActivate(vrnode Self,
vrnode Other
)

Invokes the Activate event of a Node optionally setting the __Other register.

Parameters
Self

The node to put in the __Self register of the activated event

Other

The node to put in the __Other register of the activated event


void vrAddMetaNodeObserver(string key,
string metaNode,
table callbacks
)

Adds an observer of events from a MetaNode. This notifies the script whenever a node of type metaNode is created.

Parameters
key

A unique key for this observer. Use this with vrRemoveObserver.

metaNode

The type of node to observe.

callbacks

Table of callbacks. Each value can be a string name of a global function or a lua function object. Possible keys are:

  • nodeCreated - called when a node is created. This function should have a signature of function(meta, newnode).

  • nodeRenamed - called when a node's name is changed. This function should have a signature of function(meta, node).

  • nodeParentChanged - called when a node's parent is changed. This function should have a signature of function(meta, node, oldParent, newParent).

  • nodeAddingToRecycleBin - called when a node is added to the recycle bin. This function should have a signature of function(meta, node).

  • restoredFromRecycleBin - called when a node is restored from the recycle bin, e.g. with an undo command. This function should have a signature of function(meta, node).

  • nodeDestroying - called when a node is finally deleted, usually when closing the scene. You are more likely to want nodeAddingToRecycleBin. This function should have a signature of function(meta, node).


void vrAddNodeObserver(string key,
node node,
table callbacks
)

Adds an observer of events from a node. This notifies the script in certain circumstances - see the callbacks parameter.

Parameters
key

A unique key for this observer. Use this with vrRemoveObserver.

node

The node to observe.

callbacks

Table of callbacks. Each value can be a string name of a global function, or a lua function object, and should have a signature of function(node). Possible keys are:

  • valuesChanged - called when any of the node values change.

  • addingToRecycleBin - called when the node is sent to the recycle bin.

  • restoredFromRecycleBin - called when the node is restored from the recycle bin, e.g. with an undo command.

  • nodeDestroyed - called when the node is finally deleted, usually when closing the scene. You are more likely to want addingToRecycleBin.


void vrAddPropertyObserver(string key,
Any valueChangedcallback,
string metaName,
string propName,
vrnode user
)

Adds an observer of events from a property. This notifies the script whenever the propName property value of any node of type metaType is changed.

Parameters
key

A unique key for this observer. Use this with vrRemoveObserver.

valueChangedcallback

Lua function to call when the property changes. This function should have a signature of function(node, value). This can be a string name of a global function, or a lua function object

metaName

The type of node which owns the property.

propName

The name of the property to observe.

user

The user associated with this observer.


void vrAddSettingObserver(string key,
Any callback,
string settingPath,
vrnode user
)

Add an observer of a setting. This notifies the script whenever the setting changes.

Parameters
key

A unique key for this observer. Use this with vrRemoveObserver.

callback

Lua function to call when a node is created. This function should have a signature of function(value). This can be a string name of a global function, or a lua function object.

settingPath

The path to the setting to observe.

user

The user associated with this observer.


void vrAddToolbarButton(vrnode toolbarNode,
vrnode groupNode,
string name,
number type,
string caption,
string icon,
string command,
string userString,
string clusterScope,
string statusTxt
)

Adds a button to a toolbar dock group.

Parameters
toolbarNode

The toolbar dock to add the button to.

groupNode

The toolbar dock group to add the button to.

name

The name of the button node.

type

The button type.

caption

The button caption.

icon

The icon for the button.

command

The lua command for the button.

userString

The user parameters for the lua command.

clusterScope

The cluster scope of the button.

statusTxt

The status text displayed while hovering over the button


vrnode vrAddToolbarButtonGroup(vrnode toolbarUINode,
string groupName,
boolean hasScrollBar
)

Adds a new group for toolbar buttons to be attached to.

Parameters
toolbarUINode

The tool tab node to attach the button group to

groupName

The name of the button group

hasScrollBar

Whether to allow the group to scroll

Returns

the group node


vrnode vrAddToolbarDock(vrnode notebookNode,
string tabName,
string tabIcon
)

Adds a docked window to a notebook that toolbars can be added to.

Parameters
notebookNode

The notebook uinode to dock to

tabName

The title of the frame

tabIcon

The icon of the frame

Returns

the dock node


void vrAddTransformNodeObserver(string key,
Any transformCallback,
Any enabledCallback,
vrnode node,
vrnode user
)

Add an observer to the SGNode of a vrtree node.

Parameters
key

A unique key for this observer. Use this with vrRemoveObserver.

transformCallback

Lua function to call when the nodes transform changes. This function should have a signature of function(node, transform). This can be a string name of a global function, or a lua function object

enabledCallback

Lua function to call when the nodes enabled state changes. This function should have a signature of function(node, enabled). This can be a string name of a global function, or a lua function object

node

The node to observe.

user

THe user associated with this observer.


number vrAngleRadians(number arcLength,
number radius
)

Calculates the angle of an arc in radians.

Parameters
arcLength

The length of the arc

radius

The radius of the circle

Returns

The angle


vrnode vrAnnotationCreate(vrvec3 worldPos,
vrvec3 worldRot,
vrnode targetNode
)

Create an annotation at the specified location, linked to the specified object.

Parameters
worldPos

World location of the annotation point

worldRot

World rotation of the annotation point

targetNode

Object being annotated

Returns

The new annotation


Create a comment on an annotation.

Returns

The new comment


Create a viewpoint on an annotation.

Returns

The new viewpoint


void vrAnnotationDelete(vrnode annotation)

Delete an annotation and all associated comments and viewpoints.


Delete a comment from an annotation.


Delete a viewpoint from an annotation.


Activates an interactive editor for editing an annotation comment.


Gets the text from an annotation comment.


Lists all annotations in the scene.

Returns

List of annotation nodes


table vrAnnotationListComments(vrnode annotation)

Lists all comments in an annotation.

Returns

List of comment nodes


Lists all viewpoints in an annotation.

Returns

List of viewpoint nodes


vrnode vrAnnotationNext(number flyTime)

Flies to and returns the next annotation after the currently active one.

Parameters
flyTime

The number of seconds to spend flying to the viewpoint


vrnode vrAnnotationPrev(number flyTime)

Flies to and returns the previous annotation before the currently active one.

Parameters
flyTime

The number of seconds to spend flying to the viewpoint


void vrAnnotationSetActive(vrnode annotation,
number flyTime
)

Sets the specified annotation as the active one and flies to its default viewpoint.

Parameters
flyTime

The number of seconds to spend flying to the viewpoint


void vrAnnotationSetCommentText(vrnode comment,
string text
)

Sets the text in an annotation comment.


void vrAnnotationSetDefaultViewpoint(vrnode annotation,
vrnode viewpoint
)

Sets the default viewpoint for an annotation.


Toggles the visibility of annotation comments and other information gizmos.


Recaptures the view from the specified viewpoint.


void vrAppCommandAdd(string commandName)

Adds an app command and binds a lua function call to it.


void vrAppCommandBind(string commandName,
Any func
)

Binds a lua function to an app command.


string vrAppDir()

Gets the Visionary Render application directory.

Returns

Absolute path to the folder containing visren-app.exe


vrnode vrApplyForce(vrnode node,
vrvec3 force,
vrvec3 relPos,
number duration
)

Applies a force to an object causing a dynamics response.


boolean vrApproxEquals(Any left,
Any right,
number prec
)

Returns whether or not two items are approximately equal.

Parameters
prec

Override the default epsilon value used for comparing floating point values


number vrArcLength(number angleRadians,
number radius
)

Calculates the length of an arc.

Parameters
angleRadians

The angle to measure

radius

The radius of the circle

Returns

The length


number vrArcRadius(number arcLength,
number angleRadians
)

Calculates the radius of an arc.

Parameters
arcLength

The length of the arc

angleRadians

The angle of the arc

Returns

The radius


void vrArrange(vrnode targetNode,
string type
)

Arranges assemblies into a grid based on their bounds.

Parameters
targetNode

ViewSelectionContainer holding a selection of nodes to arrange

type

Type of grid (alignment):

  • gridXY

  • gridXZ

  • gridYZ


void vrAssemblyLookAt(vrnode assembly,
vrvec3 eyePos,
vrvec3 lookAtPos,
vrvec3 upVec
)

Rotates the assembly so that it is looking at the given position.

Parameters
eyePos

New position for the assembly

lookAtPos

Position the assembly is looking at along it's Z axis

upVec

World up vector


number vrBitsToInteger(boolean ...)

Converts boolean values to an integer.

Parameters
...

Values (1 or 0, or true or false) that make up the bit field.

Returns

Integer composed of the individual bits provided


void vrBodyAddImpulse(vrvec3 position_vector,
vrvec3 rotation_vector
)

Applies delta to the camera as if the mouse was used to move it.

Parameters
position_vector

Amount of force to apply to positional movement

rotation_vector

Amount of force to apply to rotation


void vrBodyAddImpulseMouse(number x,
number y,
string mode
)

Moves the camera by simulating mouse movement.

Parameters
x

Distance of horizontal mouse movement. Negative values are left, positive are right

y

Distance of vertical mouse movement. Positive values are up, negative are down

mode

The mode of mouse control:

  • LOOK

  • PAN

  • ORBIT


void vrBodyClearImpulse(boolean b)

Resets the delta of the camera.

Parameters
b

Bool whether to apply the reset or not


Connects to a users body.

Parameters
user

The user node to connect to


void vrBodyFlyTo(vrnode node,
number time,
boolean immersive,
boolean addToStack
)

Flies the body to the world position of node, over time seconds.

Parameters
immersive

Whether or not to apply the immersive flyto animation

addToStack

Whether to add this flyto location to the history for vrBodyStepBack/vrBodyStepForward


void vrBodyFlyToFit(vrnode node,
number time,
number fillFraction,
boolean immersive,
boolean addToStack
)

Flies the body to a position where it can see the whole of node from that angle, over time seconds.

Parameters
node

The node to fly to

time

The number of seconds to fly

fillFraction

Optional, defines how much of the screen the object will take up. 0.0 to 1.0

immersive

Whether or not to apply the immersive flyto animation

addToStack

Whether to add this flyto location to the history for vrBodyStepBack/vrBodyStepForward


void vrBodyFlyToFitBounds(vrnode node,
number time,
number fillFraction
)

Flies the body to a position where it can see the whole of node, over time seconds.

Parameters
node

The node to fly to

time

The number of seconds to fly

fillFraction

Optional, defines how much of the screen the object will take up. 0.0 to 1.0


void vrBodyFlyToFitSphere(vrvec3 center,
number radius,
number time,
number fillFraction
)

Flies the body to a position where it can see the whole of a bounding sphere, over time seconds.

Parameters
center

The centre of the sphere

radius

The radius of the sphere

time

The number of seconds to fly

fillFraction

defines how much of the screen the object will take up. 0.0 to 1.0


void vrBodyFlyToLookAt(vrnode node,
number time,
vrvec3 direction
)

Flies the body to a position where it is looking at the selected object from the specified direction, over time seconds.

Parameters
node

The node to fly to

time

The number of seconds to fly

direction

A unit direction vector in world coordinates


void vrBodyFlyToWorldPos(vrvec3 pos,
vrvec3 rot,
number time,
boolean fadeInOut,
boolean addToStack,
vrnode user
)

Flies the body to a specific position and rotation, over time seconds.

Parameters
fadeInOut

Whether to fade the view when moving to this location

addToStack

Whether to add this flyto location to the history for vrBodyStepBack/vrBodyStepForward

user

User to move (defaults to local user)


Returns the object to which the view is currently connected.


Gets the user's body position and rotation.

Parameters
user

The user to query (defaults to local user)

Returns

User's world position

User's world rotation


void vrBodyLookAt(vrnode subjectNode,
number time
)

Rotates the body so that it is looking at subjectNode, over time seconds.


void vrBodySetAng(vrvec3 direction)

Sets the orientation of the body.

Parameters
direction

X,Y,Z rotation values in degrees


void vrBodySetOrbitPoint(vrvec3 orbit_vector)

Sets the camera's orbit point.

Parameters
orbit_vector

The position of the orbit point


void vrBodySetPitch(number pitch)

Sets the pitch of the body.

Parameters
pitch

Pitch in degrees


void vrBodySetRoll(number roll)

Sets the roll of the body.

Parameters
roll

Roll in degrees


void vrBodySetWorldPos(vrvec3 pos,
vrvec3 rot,
vrnode user
)

Sets the body position and rotation instantly.

Parameters
pos

World position

rot

World rotation

user

User to move (defaults to local user)


void vrBodyStepBack(number time,
boolean fadeInOut
)

Steps back to the previous viewport or camera position.


void vrBodyStepForward(number time,
boolean fadeInOut
)

Steps forward to the next viewport or camera position.


Captures the current state of the Lua global environment.


void vrCaptureViewpoint(vrnode viewpoint,
number size,
string captureComplete,
string textureCreate
)

Captures the view from a specified viewpoint into a texture.

Parameters
viewpoint

Viewpoint node to capture

size

Size of image to capture to (square)

captureComplete

Name of a Lua function to call with the complete catured texture

textureCreate

Name of a Lua function to call to create a texture node


boolean vrClearSelection(vrnode selectionGroup)

Clears the selection in the specified selection group.

Parameters
selectionGroup

The selection group to clear

Returns

true if the selection was cleared


void vrCloseNotebookPane(string notebookName,
string paneName
)

Closes the specified pane of the given notebook.

Parameters
notebookName

Specifies the name of the notebook.

paneName

Specifies the name of the pane.


void vrCloseSequence(vrnode selection)

Closes the specified sequence in the sequencer window.


Returns true if the local user is a cluster master.


Returns the cluster master's user node, or the local user node if unclustered.


DEPRECATED - use vrShowPropertyWindow.


DEPRECATED - use vrShowScriptWindow.


DEPRECATED - use vrShowScriptWindow.


DEPRECATED - use vrPopupToolsWindow.


DEPRECATED - use vrResetWindows.


DEPRECATED - use vrSelectNodes.


DEPRECATED - use vrSelectNodes.


DEPRECATED - use vrShowPropertyWindow.


DEPRECATED - use vrShowPropertyWindow.


DEPRECATED - use vrShowSequencer.


DEPRECATED - use vrShowSettingsWindow.


Returns true if the local user is a cluster slave.


DEPRECATED - use vrTriggerRename.


boolean vrConfigModeAvailable(number mode)

Returns true or false if the specified mode is available.

Parameters
mode

Immersive mode value

Returns

true if the mode is availble


Constrains a node with a TransformLimit to a bounding box.

Parameters
node

The node to Constrain


Any vrCopy(Any c)

Returns a copy of a Vector, Matrix, Ray, Sphere, AABBox, Quaternion or Plane.


void vrCopyBitmap(vrnode node)

Copies the texture data from a node onto the Windows clipboard.

Parameters
node

Texture node to copy


vrnode vrCopyNode(vrnode fromNode,
vrnode toNode,
boolean recursive,
boolean ancestors,
boolean noSave,
boolean noHistory
)

Copies a node, and optionally its children, and adds that as a child of another node.

Parameters
fromNode

The node to copy from

toNode

The node which will become the parent of the copy

recursive

Whether to also copy descendants

ancestors

Whether to also copy ancestors (excluding their children) that lead to fromNode. In this case the return value is the clone of the oldest ancestor

noSave

Whether the new copy is able to be saved in files

noHistory

Whether the new copy should have an undo history

Returns

The new copy of the node


void vrCopySelectionToClipboard(vrnode selectionToCopy)

Copies the specified selection group to the clipboard.


void vrCopyToClipboard(vrnode nodeToCopy)

Copies the specified node to the clipboard.


void vrCopyValues(vrnode fromNode,
vrnode toNode,
number mask
)

Copies the property values from one node to another of the same MetaNode type.

Parameters
fromNode

The node to copy properties from

toNode

The node to copy to

mask

Bitmask where any bits set to 0 mean that property will not be copied. Use vrBitsToInteger to create this bit mask


Creates a new gradient.


vrnode vrCreateNode(string metaName,
string nodeName,
vrnode parent,
number flags,
vrnode beforeSibling
)

Creates a new node and attaches it to a parent node.

Parameters
metaName

The type of node to create

nodeName

The name of the newly created node

parent

The parent of the newly created node

flags

Any additional flags to set on the new node

beforeSibling

The sibling to insert this before (defaults to inserting at the end of the parent's children)

Returns

The newly created node


Adds a child sequence to a selected node or the Scenes node.


vrnode vrCreateShape(string type,
vrnode parent
)

Creates a new shape and attaches it to a parent node.

Parameters
type

Type of shape to create:

  • plane

  • cube

  • sphere

  • cubicsphere

  • disc

  • cone

  • cylinder

  • arrow

  • sponge^3

  • sponge^4

  • torus

  • knot

  • room

  • room2

  • axis

parent

Parent of the new node

Returns

The new assembly node referencing the new shape model


Create the user interface components from the user interface metanode.

Parameters
uinode

The user interface metanode


vrnode vrCreateViewpoint(vrnode parent,
string name
)

Creates a viewpoint at the current camera position.

Parameters
parent

Parent of the new viewpoint node. If not specified, viewpoint is created under the root ViewpointList node in the scenes tree

name

The name of the new viewpoint

Returns

The new viewpoint node


vrvec3 vrCross(Any vec1,
Any vec2
)

Returns the cross product of two vectors. Both vectors must be the same type.

Parameters
vec1

Vector 1 {x, y} or {x, y, z}.

vec2

Vector 2 {x, y} or {x, y, z}.


Gets the first assembly currently under the mouse cursor.


Gets the first geogroup currently under the mouse cursor.


Gets the first model currently under the mouse cursor.


Gets the first visual currently under the mouse cursor.


void vrCursorIgnoreNode(vrnode node,
boolean ignore
)

Makes the specified node unpickable with the cursor.

Parameters
ignore

True makes it unpickable, false makes it pickable.


string vrDataFile(string path)

Gets the specified file path from the Visionary Render application data directory, or an empty string if it does not exist.

Parameters
path

Path to the data file relative to the application data directory

Returns

Absolute path to the specified data file


Deletes the children of a node.

Parameters
node

The node to delete the children of


void vrDeleteNode(vrnode node)

Deletes a node and, if present, its children.

Parameters
node

The node to delete


Recursively deletes all unreferenced nodes in this branch.

Parameters
node

Node to start deleting from


Prints to the log a description of the node, its property names and values.


void vrDeveloperSaveTree(vrnode node,
string file,
boolean newUUID
)

Saves the tree from a specified node down.

Parameters
node

The node to start saving from

file

Path to the file to save as

newUUID

True removes the UUIDs from nodes into the file.


number vrDot(Any vec1,
Any vec2
)

Returns the dot product of two vectors. Both vectors must be the same type.

Parameters
vec1

Vector 1 {x, y} or {x, y, z}.

vec2

Vector 2 {x, y} or {x, y, z}.


Enables networking capabilities.


Makes a button available when the specified mode is avaliable.

Parameters
node

Button node to enable

mode

Immersive mode value


Makes a button available when an Oculus Rift is connected.

Parameters
node

Button node to enable


Makes a button available when an Oculus Touch is connected.

Parameters
node

Button node to enable


Makes a button available when an OpenVR HMD is connected.

Parameters
node

Button node to enable


Makes a button available when a zSpace device is detected.

Parameters
node

Button node to enable


Registers the switch to interactive button to listen for immersion mode changes and enable/disable depending on those.

Parameters
node

Button node to enable


Disables a menu item depending on the iray bit & the immersion mode.

Parameters
node

Button node to enable


Registers the switch to photoreal button to listen for immersion mode changes and enable/disable depending on those.

Parameters
node

Button node to enable


void vrExtractBinaryAssets(vrnode fromNode,
string path,
boolean overwrite
)

Extracts binary data from texture or audio nodes.

Parameters
fromNode

The node to extract from

path

Directory or file to save data to

overwrite

Whether to overwrite existing files on disk


boolean vrFileExists(string path)

Returns true if the specified file exists.

Parameters
path

Relative or absolute path to test

Returns

True if the file exists


void vrFilterView(string view,
string metaType
)

Sets the filter for a specified view.

Parameters
view

The name of the view

metaType

The type to filter


Finds and optimises model nodes.


boolean vrFolderExists(string path)

Returns true if the specified folder exists.

Parameters
path

Relative or absolute path to test

Returns

True if the folder exists


void vrForkApp()

Forks the application into another process.


void vrGalleryRequestImport(string typeName,
string importerName,
string prompt,
vrnode destination
)

Imports a file using an importer registered with the gallery.

Parameters
typeName

Specifies the name of a gallery asset type.

importerName

Specifies the name of a registered importer, or an empty string to use all importers.

prompt

A prompt to display in the file dialogue.

destination

The parent node for the imported data.


table vrGatherMetaNode(string metaName,
vrnode node
)

Returns a list of all nodes of given type in the scene and optionally under a given node.

Parameters
metaName

The type of node to list

node

The node to start searching from

Returns

Array of nodes of the specified type


Generates a lightning polyline.


void vrGeometryOp(string type,
vrnode node
)

Performs a geometry operation.

Parameters
type

The type of operation:

  • weld

  • normals

  • tangents

  • uv

  • tess

  • sort

  • invert

  • optimise

  • split

  • explode

  • prune

  • sieve

  • recentre

  • transform

  • merge

node

The node to perform the operation on


Gets the node which activated the event.


void vrGetAdapterInfo(string entry)

DEPRECATED.


MULTI< boolean, string > vrGetAllDocHelp(boolean doxyFormat,
string outputPath
)

Gets the entire Lua API reference, either to a string or a file.

Parameters
doxyFormat

Whether to format the API docs in doxygen format

outputPath

Path to file to write to instead of returning the string

Returns

Success status

Lua API Documentation


MULTI< vrnode, vrvec3 > vrGetBody(vrnode user,
boolean world,
boolean atHeadHeight
)

Gets the offset from the body to the user's standing position.

Parameters
user

User's body to get (defaults to local user)


Returns the node containing the clipboard content, or nil if nothing is on the clipboard.


boolean vrGetCommandLineSwitch(string name)

Returns whether or not a command line switch was specified.

Parameters
name

The name of the command line switch

Returns

True if the command line option is present


string vrGetCommandLineSwitchValue(string name)

Returns the value of a command line switch.

Parameters
name

The name of the command line switch


table vrGetContactPoints(vrnode nodeA,
vrnode nodeB
)

Returns a list of contact points and normals between two nodes.

Returns

Array of contact information.


Get the mouse cursor's current position.

Returns

World position of the mouse cursor


Extracts the forward vector from the inverse of the current view matrix.

Parameters
viewportNode

Viewport to get the view matrix from (defaults to local user's default viewport)


Finds the user who is holding the specified node with a tracked controller. In the rare case that more than one user is holding the node, multiple values are returned. These can be handled by assigning to multiple variables or creating a table. Example usage: local user = vrGetHoldingUser(node) receives a single user local user1, user2 = vrGetHoldingUser(node) receives up to two users local users = { vrGetHoldingUser(node) } receives all users in a table.

Parameters
node

The node that is being held

Returns

The user(s) who are holding the node, or nil if no user is holding it


vrnode vrGetIconsLibrary(boolean create)

Gets the library in which browser icons are stored.

Parameters
create

Whether to create the library if it doesn't already exist


table vrGetImporterFileExtensions(string importerName)

Gets the file extensions associated with an importer plugin.

Returns

Array of file extension names


Gets the names of all installed data importer plugins.

Returns

Array of importer names


Get the position of the cursor when the mouse was last clicked.

Parameters
user

The user to obtain the last click of. Uses the local user if not specified.

Returns

World position where the mouse was last clicked


Returns the last directory selected.


Returns the selection group that was added to.


Gets the local body, regardless of any remote connections.


vrnode vrGetOrCreateNode(string metaName,
string nodeName,
vrnode parent,
number flags,
vrnode beforeSibling
)

Gets an existing node or creates one (creation attaches it to a parent node).

Parameters
metaName

The type of node to find/create

nodeName

The name of node to find, or set on the newly created node

parent

The parent node

flags

Any additional flags to set on the new node

beforeSibling

The sibling to insert this before (defaults to inserting at the end of the parent's children)

Returns

The first child of parent with specified name and type, or the newly created node if there wasn't a match


Get the node that owns this Vector, Matrix, Ray, Sphere, AABBox, Quaternion or Plane.

Returns

The owner of this data (the node that will be affected by changes to its data)


Returns the list of recent files.

Returns

Array of paths to recently opened files


Returns the list of recent folders.

Returns

Array of paths to folders from which files have recently been opened


Returns the list of recent import files.

Returns

Array of paths to files that have recently been imported


Returns the list of recent import folders.

Returns

Array of paths to folders from which files have recently been imported


Returns the name of the selected tree frame.


Gets the current tracked eye node.


Gets the current tracked hand node.

Parameters
index

-1 for default, 0, for left hand, 1 for right hand


Gets the user's current viewport layout.

Parameters
userNode

user whose viewport should be queried (defaults to local user)


MULTI< string, string > vrGetVisRenVersion()

Returns the revision number of Visionary Render being used.

Returns

Version string formatted Major.Minor.Patch


void vrGrabObjectWithTrackedHand(vrnode target,
boolean moveToHand,
boolean rotateToHand,
boolean scaleToHand,
boolean releaseOthers,
number handIndex,
vrnode user
)

Attaches a target node to the hand.

Parameters
target

The node to attach to the hand

moveToHand

Whether to match the position of the grabbed object to the hand (defaults to true)

rotateToHand

Whether to match the rotation of the grabbed object to the hand (defaults to true)

scaleToHand

Whether to match the scale of the grabbed object to the hand (defaults to true)

releaseOthers

Whether to release any other objects that were in the hand (defaults to true)

handIndex

-1 or nil for default, 0, for left hand, 1 for right hand (defaults to -1)

user

The user whose hand the object should be attached to, or nil for the current user (defaults to nil)


void vrGroupAddMember(vrnode groupNode,
vrnode memberNode
)

Adds a node to the specified group.

Parameters
groupNode

The group node

memberNode

The node to add to the group


void vrGroupRemoveMember(vrnode groupNode,
vrnode memberNode
)

Removes a node from the specified group.

Parameters
groupNode

The group node

memberNode

The node to remove from the group


Creates a snapshot of the specified group.

Parameters
groupNode

The group node

Returns

The snapshot node that was created/updated


vrnode vrGroupsRoot(boolean noCreate)

Gets the Groups root node under the Scenes tree.

Parameters
noCreate

When true, the root node will not be created if it does not exist


boolean vrHasPermission(string permission,
vrnode originatorNode
)

Queries whether or not we have a named permission.

Parameters
permission

The permission to query

originatorNode

The originator

Returns

true if the permission is present


void vrHideModalDialogues(boolean suppressed)

Suppresses all modal dialogue message boxes.

Parameters
suppressed

Whether to suppress the dialogue messages or not


Adds an undo point in to the History.


Erases the undo history.


Undoes the history to the previous history mark.


Redoes the history to the next history mark.


vrvec3 vrHSV2RGB(vrvec3 hsvColour)

Converts a HSV coiour (vec3f) to an RGB colour (vec3f)

Parameters
hsvColour

The input colour in HSV


void vrImportAssetLibrary(string file)

Imports an asset library.

Parameters
file

Path to the asset library file


boolean vrInCoroutine(string script)

Executes the specified piece of Lua in a coroutine.

Parameters
script

Lua code to execute

Returns

true if the coroutine is started successfully


boolean vrIntegerToBits(number i)

Converts an integer to a boolean value for each bit.

Parameters
i

The integer to split into bits

Returns

32 bools, one for each bit in the number


Returns true if running in a cluster configuration.


Returns true if the DEBUG compilation flag was defined.


Returns true if the scenegraph uses double precision values for matrices etc.


Returns true if the supplied node contains a script property supported by the script editor.

Parameters
node

node to check


boolean vrIsStereoAvailable(number mode)

Returns true if stereo 3D is available in the current instance of Visionary Render.

Parameters
mode

Stereo mode to check. Default (0) checks for quad buffered stereo support. All other values return true


boolean vrIsSystemNode(vrnode node)

Returns true if the system node is an ancestor of node.


boolean vrIsToolEnabled(string toolName,
vrnode userNode
)

Tests whether a named Tool is enabled.

Returns

true if it is enabled


Gets the enabled state of the user's tracking.

Returns

true if it is enabled


boolean vrIsVR4CAD()

Returns whether or not we are currently running VR4CAD.


boolean vrLaunchProcess(string cmdline,
boolean pipeOutput,
number timeout
)

Launches a command or application asynchronously.

Parameters
cmdline

The command to execute.

pipeOutput

True if the process should pipe its output to the log.

timeout

A maximum time in seconds the process can run for before being force-terminated.

Returns

True if the process started successfully.


number vrLength(Any vec)

Returns the length of a vector.

Parameters
vec

Vector {x, y} or {x, y, z}.


number vrLengthSquared(Any vec)

Returns the squared length of a vector.

Parameters
vec

Vector {x, y} or {x, y, z}.


Returns the Libraries node the tree.


void vrLinkNetwork(string host,
number port
)

Links to another application instance forming a Peer-To-Peer network.

Parameters
host

IP address or hostname to connect to

port

TCP port to connect to


string vrListExports()

List all Lua VR extension functions.

Returns

List of function names separated by new lines


DEPRECATED.


table vrListSleepingScripts(boolean details)

Lists the scripts currently suspended, awaiting resume.

Parameters
details

Whether to display additional details about each script

Returns

Array of script identifiers


void vrLoadAvatarFromFile(vrnode parent,
string filename
)

Loads an avatar from a file and places it as a child to parent node.


void vrLoadAvatarFromFileToEdit(vrnode parent,
string filename
)

Loads an avatar from a file and places it in a scene to edit. Can be saved by using Developer->Save Avatar.


void vrLoadGalleryFolders(string path)

Add sub-folders of the specified folder to the gallery.

Parameters
path

Specifies the path to the folder to search.


void vrLoadPlugin(string pluginName,
string pluginVersion,
string pluginInternalName,
string pluginDir
)

void vrLoadTree(vrnode node,
string file,
boolean supportOlder,
boolean neverBroadcast,
boolean noSave,
boolean noHistory,
boolean newUUID
)

Loads a Visionary Render format file.

Parameters
node

The node on which to load the contents of the file (use vrTreeRoot if loading a full scene)

file

The full path to the file

supportOlder

True loads older format files that may have missing information. Default (false) will fail to load older files.

neverBroadcast

DEPRECATED - remains for compatibility.

noSave

True prevents the loaded nodes from being saved.

noHistory

True prevents the loaded nodes being added to the undo history.

newUUID

True ignores UUIDs from file.


Returns the local user's node.


vrnode vrMakeArrow(vrnode parent,
string name,
number length,
number width,
number centreBias
)

Creates an arrow shape.


vrnode vrMakeBox(vrnode parent,
string name,
number width,
number height,
number depth
)

Creates a box shape.


vrnode vrMakeCylinder(vrnode parent,
string name,
number bottomRadius,
number topRadius,
number height
)

Creates a cylinder shape.


vrnode vrMakeEllipsoid(vrnode parent,
string name,
number radiusX,
number radiusY,
number radiusZ
)

Creates an ellipsoid shape.


vrnode vrMakePlane(vrnode parent,
string name,
number hsize,
number vsize
)

Creates a plane shape.


vrnode vrMakeTorus(vrnode parent,
string name,
number radius,
number rez,
number ringRadius,
number ringRez
)

Creates a torus shape.


Return an identity 3x3 Matrix.


Return an identity 4x4 Matrix.


vrmatrix4 vrMat4Frustum(number left,
number right,
number bottom,
number top,
number nearval,
number farval,
number focalval
)

Return a frustum projection matrix.


vrmatrix4 vrMat4Ortho(number left,
number right,
number bottom,
number top,
number nearval,
number farval
)

Return an orthographic projection matrix.


vrmatrix4 vrMat4Ortho2D(number left,
number right,
number bottom,
number top
)

Return a 2D orthographic projection matrix.


number vrMatDeterminant(Any m)

Returns the determinant of the matrix.

Parameters
m

The matrix to get the determinant of.


number vrMatGetValue(Any m,
number x,
number y
)

Get the value of an element of a matrix.

Parameters
m

The matrix to select the element from

x

The column of the element to select.

y

The row of the element to select.


Returns the inverse of a 4x4 matrix.

Parameters
m

The matrix to take the transpose of.


Returns an orthogonal matrix.

Parameters
m

The matrix to orthonormalise.

Returns

Orthogonal mat3 or mat4 depending on the type passed in


vrmatrix4 vrMatRotateEulerX(Any m,
number v
)

Return M rotated on the X axis by angle V.

Parameters
m

The matrix to rotate.

v

The angle to rotate M by.


vrmatrix4 vrMatRotateEulerY(Any m,
number v
)

Return M rotated on the Y axis by angle V.

Parameters
m

The matrix to rotate.

v

The angle to rotate M by.


vrmatrix4 vrMatRotateEulerZ(Any m,
number v
)

Return M rotated on the Z axis by angle V.

Parameters
m

The matrix to rotate.

v

The angle to rotate M by.


vrmatrix4 vrMatScale(Any m,
Any v
)

Return M scaled by vector V. If V is a scalar then a vector in which x=v, y=v, z=v will be used.

Parameters
m

The matrix to scale.

v

The vector or scalar to scale M by.


void vrMatSetValue(Any m,
number x,
number y,
number v
)

Set the value of an element of a matrix.

Parameters
m

The matrix of whose elements to set.

x

The column of the element to select.

y

The row of the element to select.

v

The value to set the element.


string vrMatToString(Any m)

Get a string representation of a matrix.

Parameters
m

The matrix to stringify


Return M translated by the vector V.

Parameters
m

The matrix to translate.

v

The vector to translate the matrix by.


Any vrMatTranspose(Any m)

Returns the tranpose of a 3x3 matrix, or a 4x4 matrix with the 3x3 component transposed.

Parameters
m

The matrix to take the transpose of.

Returns

vrmat3 or vrmat4 depending on the type passed in


void vrMergeTree(string file,
vrnode analyzeSettings
)

Merges a Visionary Render format file with the current scene.

Parameters
file

Path to the file to merge

analyzeSettings

Merge Analysis settings node


string vrMessageBox(string text,
string caption,
string flagList
)

Displays a message box to the user.

Parameters
text

The main body of the message.

caption

The text to put in the title bar.

flagList

String indicating what kind of input is required, and an icon to show.

  • "okcancel,warning" would display a box with OK and CANCEL buttons, with a warning icon.

  • "yesno,question" would display a box with YES and NO buttons, with a question icon.

  • "abortretryignore,error" would display ABORT, RETRY and IGNORE buttons, with an error icon.

Returns

Returns one of the following based on selected button: cancel, continue, no, ok, retry, tryagain, yes


boolean vrMetaNodeExists(string metaName,
boolean versioned
)

Returns true if there is a metanode with the given name.

Parameters
metaName

The metanode name to query

versioned

Whether to query versioned metanode names

Returns

True if exists


MULTI< string, number, string, number > vrMetaNodeGetProperty(string metaName,
string propName
)

Gets the name, type and type description of a MetaNode property.

Returns

The name of the property

The type of the property

The description of the type of property

The number of elements in the property (e.g. greater than 1 for arrays)


MULTI< string, number, string, boolean, number > vrMetaNodeGetPropertyByIndex(string metaName,
number idx
)

Gets the name, type and type description of a MetaNode property.

Parameters
metaName

The name of the metanode

idx

The index of the property (zero based).

Returns

The name of the property

The type of the property

The description of the type of property

Whether the property can be saved in a file

The number of elements in the property (e.g. greater than 1 for arrays)


number vrMetaNodeGetPropertyCount(string metaName)

Gets the number of properties defined by a MetaNode.

Parameters
metaName

The name of the metanode

Returns

The number of properties on the metanode


boolean vrModifierPressed(number id)

Tests whether any modifier keys are pressed.

Parameters
id

Modifier ID. 0 = Ctrl, 1 = Shift, 2 = Alt

Returns

true if the modifier key is currently being pressed


void vrNetworkSetRetryConnect(boolean allowRetry)

Sets whether failed calls to vrLinkNetwork should retry until the user manual aborts them.

Parameters
allowRetry

Whether to retry failed calls to vrLinkNetwork


Any vrNodeArrayGetElement(vrnode node,
string propName,
number element
)

Gets the value of an element of an array property.

Parameters
node

The node to read the property element from

propName

The name of the array property

element

The index of the array element (zero based)

Returns

The value in the array at the specified index


number vrNodeArrayGetSize(vrnode node,
string propName
)

Gets the size of an array property.

Parameters
node

Node to get the property array size of

propName

Property to get the size of

Returns

The size of the array property


void vrNodeArrayPop(vrnode node,
string propName
)

Pops a value from the end of an array property.

Parameters
node

Node to pop the item from

propName

Property to pop the item from


void vrNodeArrayPush(vrnode node,
string propName,
Any value
)

Pushes a new value to the end of an array property.

Parameters
node

The node to push the item to

propName

The property to push the item to

value

The value to push to the end of the array


void vrNodeArraySet(vrnode node,
string propName,
...
)

Sets the values of an array property to a new array.

Parameters
...

Values to insert into the array. Specify as many as needed.


void vrNodeArraySetElement(vrnode node,
string propName,
number element,
Any value
)

Sets the value of an element of an array property.

Parameters
node

The node to set the property element on

propName

The name of the array property

element

The index of the element to set

value

The value to insert into the specified index


void vrNodeArraySetSize(vrnode node,
string propName,
number newSize
)

Sets the size of an array property.

Parameters
node

Node to affect the property array size of

propName

Property to set the array size of

newSize

New size of the array property


void vrNodeCaptureTransform(vrnode node,
boolean recursive,
boolean overwrite
)

Captures the transform of a node, overwriting any existing saved transform.

Parameters
node

The node to capture

recursive

True captures all the child transforms too.

overwrite

True overwrites any exisiting saved transform. False will only create a new one if there is not a saved one already.


void vrNodeComposeLocalTransform(vrnode node,
vrvec3 p,
vrvec3 r,
vrvec3 s,
string prop
)

Compose the nodes local transform property from seperate position, rotation and scale tables / vectors.

Parameters
node

The node to set the local transform of

p

The local position

r

The local rotation

s

The local scale

prop

The name of the property containing the transform


Compose the nodes world transform property from seperate position, rotation and scale tables / vectors.

Parameters
node

The node to set the transform of

p

The world position

r

The world rotation

s

The world scale


void vrNodeCopyValue(vrnode fromNode,
vrnode toNode,
string propName
)

Copies the value of a property from one node to another of the same MetaNode type.

Parameters
fromNode

The node to copy from

toNode

The node to copy to

propName

The name of the property to copy


Decomposes the nodes local transform property into seperate postion, rotation and scale tables / vectors.

Parameters
node

The node to get the transform of

prop

The name of the property containing the transform

Returns

The local position

The local rotation

The local scale


Decomposes the nodes world transform property into seperate postion, rotation and scale tables / vectors.

Parameters
node

The node to get the transform of

Returns

The world position

The world rotation

The world scale


vrnode vrNodeFindChild(vrnode node,
string path,
boolean caseSensitive
)

Finds a descendant of a node by path.

Parameters
node

The node to search from

path

The path or name of the node to search from

caseSensitive

Whether to match case in the path

Returns

The node at the specified path, or false if not found


void vrNodeForEachChild(vrnode node,
Any function
)

Calls a function for each child of a node.

Parameters
node

The parent node

function

The function to call for each child node. This function should have a signature of function(node). This can be a string name of a global function, or a lua function object. If the function returns a value other than nil, the function will not be called for further children and the value will be returned to the caller


void vrNodeForEachChildOfType(vrnode node,
string metaType,
Any function
)

Calls a function for each child of a node that matches a specified type.

Parameters
node

The parent node

metaType

The type of child nodes to find

function

The function to call for each child node. This function should have a signature of function(node). This can be a string name of a global function, or a lua function object. If the function returns a value other than nil, the function will not be called for further children and the value will be returned to the caller


vrnode vrNodeGetAncestor(vrnode node,
string metaName
)

Gets the first ancestor of the specified type.

Parameters
node

The node to get the ancestor of

metaName

The type of ancestor to look for

Returns

Ancestor node of the specified type, or false if there isn't one


Gets all nodes that link to this node.

Parameters
node

The node to look for references to

Returns

Array of nodes that have link properties pointing to this node


vrnode vrNodeGetChild(vrnode node,
string metaType,
string name
)

Gets the first child of a node.

Parameters
node

The node to get the child of

metaType

The type of child to get

name

The name of the child to get

Returns

The first child node, of the type in the metaType parameter, if specified, or false if there are no suitable child nodes


Gets the combined bounding box of all a nodes children, relative to that node.

Returns

The min point of the bounding box

The max point of the bounding box


Gets a nodes child by its zero-based index.

Parameters
node

The node to get the child of

idx

The index of the child (zero based)

Returns

The specified child node, or false if out of range


Counts the children of a node.

Parameters
node

The node whose children to count

Returns

The number of direct child nodes


DEPRECATED.


Gets the local bounding box of a node.

Returns

The min point of the bounding box

The max point of the bounding box


Gets the centre of the local bounding box of a node.


Gets the centre of the local bounding sphere of a node.


Gets the local bounding box and sphere of a node.

Returns

The dimensions of the local bounding box

The radius of the bounding sphere


Queries whether or not this node's last modification was made by the local visionary render instance.

Parameters
node

The node to query.


void vrNodeGetLocalMatrix(vrnode node,
string propName
)

DEPRECATED.


Gets the local position of the node.

Parameters
node

The node to get the vector from

prop

The name of the property to get

Returns

The vector value


number vrNodeGetLocalPositionX(vrnode node,
string prop
)

Gets the local x position of the node.

Parameters
node

The node to read the value from

prop

The name of the property to read

Returns

The value of the vector element


number vrNodeGetLocalPositionY(vrnode node,
string prop
)

Gets the local y position of the node.

Parameters
node

The node to read the value from

prop

The name of the property to read

Returns

The value of the vector element


number vrNodeGetLocalPositionZ(vrnode node,
string prop
)

Gets the local z position of the node.

Parameters
node

The node to read the value from

prop

The name of the property to read

Returns

The value of the vector element


Gets the local rotation of the node.

Parameters
node

The node to get the vector from

prop

The name of the property to get

Returns

The vector value


number vrNodeGetLocalRotationX(vrnode node,
string prop
)

Gets the local x rotation of the node.

Parameters
node

The node to read the value from

prop

The name of the property to read

Returns

The value of the vector element


number vrNodeGetLocalRotationY(vrnode node,
string prop
)

Gets the local y rotation of the node.

Parameters
node

The node to read the value from

prop

The name of the property to read

Returns

The value of the vector element


number vrNodeGetLocalRotationZ(vrnode node,
string prop
)

Gets the local z rotation of the node.

Parameters
node

The node to read the value from

prop

The name of the property to read

Returns

The value of the vector element


vrvec3 vrNodeGetLocalScale(vrnode node,
string prop
)

Gets the local scale of the node.

Parameters
node

The node to get the vector from

prop

The name of the property to get

Returns

The vector value


number vrNodeGetLocalScaleX(vrnode node,
string prop
)

Gets the local x scale of the node.

Parameters
node

The node to read the value from

prop

The name of the property to read

Returns

The value of the vector element


number vrNodeGetLocalScaleY(vrnode node,
string prop
)

Gets the local y scale of the node.

Parameters
node

The node to read the value from

prop

The name of the property to read

Returns

The value of the vector element


number vrNodeGetLocalScaleZ(vrnode node,
string prop
)

Gets the local z scale of the node.

Parameters
node

The node to read the value from

prop

The name of the property to read

Returns

The value of the vector element


void vrNodeGetLocalTransform(vrnode node,
string propName
)

DEPRECATED.


string vrNodeGetMetaNode(vrnode node,
boolean versioned
)

Gets the name of the MetaNode that a node is an instance of. This can also be referred to as the node type.

Parameters
node

Node to get the type of

versioned

Whether to get the full versioned metanode name rather than the unversioned name

Returns

The node type


string vrNodeGetName(vrnode node)

Gets the name of a node.

Parameters
node

The node to get the name of

Returns

The name of the node


boolean vrNodeGetNoHistory(vrnode node)

Queries whether this node can be recorded in the history for undo/redo operations.

Parameters
node

The node to query the 'no history' flag of

Returns

true if the node is flagged as 'no history', i.e. true if the node cannot be recorded for undo/redo


boolean vrNodeGetNoSave(vrnode node)

Queries whether this node can be saved in a VRText/VRNative file.

Parameters
node

The node to query the 'no save' flag of

Returns

true if the node is flagged as 'no save', i.e. true if the node cannot be saved.


Queries whether this node can be affected by simulations, such as physics and collision.

Parameters
node

The node to query the 'no simulation' flag of

Returns

true if the node is flagged as 'no simulation', i.e. the physics system ignores this node


Gets the parent of a node.

Parameters
node

The node to get the parent of

Returns

The parent node


string vrNodeGetPath(vrnode node)

Gets the encoded path to a node relative to the tree root.

Parameters
node

The node to get the path of

Returns

The encoded path (special characters are encoded, e.g. space = %20


Gets the world position of the node.

Parameters
node

The node to get the world vector from

Returns

The vector value


Gets the world x position of the node.

Parameters
node

The node to get the x value of

Returns

The value of the vector element


Gets the world y position of the node.

Parameters
node

The node to get the y value of

Returns

The value of the vector element


Gets the world z position of the node.

Parameters
node

The node to get the z value of

Returns

The value of the vector element


vrnode vrNodeGetPreviousSibling(vrnode node,
string metaType,
string name
)

Gets the previous sibling (adjacent) node to a node.

Parameters
metaType

The type of sibling to get

name

The name of the child to get

Returns

The previous sibling node, of the type in the metaType parameter, if specified, or false if there are no suitable siblings


string vrNodeGetRelativePath(vrnode node,
vrnode relativeTo
)

Gets the encoded path to a node, relative to another node.

Parameters
node

The node to get the path of

relativeTo

The node to get the path relative to

Returns

The encoded relative path (special characters are encoded, e.g. space = %20


MULTI< vrvec3, vrvec3, vrvec3 > vrNodeGetRelativeTransform(vrnode node,
string propName,
vrnode otherNode
)

Gets the position, rotation and scale of the world transform of one node relative to another.

Returns

The relative world position

The relative world rotation

The relative world scale


Gets the world rotation of the node.

Parameters
node

The node to get the world vector from

Returns

The vector value


Gets the world x rotation of the node.

Parameters
node

The node to get the x value of

Returns

The value of the vector element


Gets the world y rotation of the node.

Parameters
node

The node to get the y value of

Returns

The value of the vector element


Gets the world z rotation of the node.

Parameters
node

The node to get the z value of

Returns

The value of the vector element


Gets the world scale of the node.

Parameters
node

The node to get the world vector from

Returns

The vector value


number vrNodeGetScaleX(vrnode node)

Gets the world x scale of the node.

Parameters
node

The node to get the x value of

Returns

The value of the vector element


number vrNodeGetScaleY(vrnode node)

Gets the world y scale of the node.

Parameters
node

The node to get the y value of

Returns

The value of the vector element


number vrNodeGetScaleZ(vrnode node)

Gets the world z scale of the node.

Parameters
node

The node to get the z value of

Returns

The value of the vector element


vrnode vrNodeGetSibling(vrnode node,
string metaType,
string name
)

Gets the sibling (adjacent) node to a node.

Parameters
metaType

The type of sibling to get

name

The name of the child to get

Returns

The next sibling node, of the type in the metaType parameter, if specified, or false if there are no suitable siblings


vrnode vrNodeGetTail(vrnode node,
string metaType,
string name
)

Gets the last child of a node.

Parameters
metaType

The type of child to get

name

The name of the child to get

Returns

The last child node, of the type in the metaType parameter, if specified, or false if there are no suitable child nodes


table vrNodeGetTraits(vrnode node)

Gets the list of traits that this node has. Can also be thought of as the base class of a node (e.g. Texture, Viewport, etc). This function is expensive and can affect performance. To check a specific trait use vrNodeHasTrait.

Parameters
node

Node to get the traits of

Returns

Array of traits that this node has


Any vrNodeGetValue(vrnode node,
string propName
)

Gets the value of a property of a node.

Parameters
node

The node to read the property from

propName

The name of the property to read

Returns

The value of the property


Any vrNodeGetValueByIndex(vrnode node,
number idx
)

Gets the value of a property of a node finding the property by its index.

Parameters
node

The node to read the property from

idx

The index of the property to read

Returns

The value of the property


DEPRECATED.


void vrNodeGetWorldTransform(vrnode node,
string propName
)

DEPRECATED.


boolean vrNodeHasTrait(vrnode node,
string traitName
)

Checks if the node is of a type with a specific trait. This is a lot faster than vrNodeGetTraits.

Parameters
node

The node to check the traits of

traitName

The name of the trait to check

Returns

true if the node has the specified trait


boolean vrNodeIsAncestor(vrnode node1,
vrnode node2
)

Query whether the first specified node is an ancestor of the second.

Parameters
node1

The first node

node2

The second node

Returns

true if the first node is an ancestor of the second


boolean vrNodeIsInGroup(vrnode node,
vrnode groupNode
)

Returns true is the node is in the group.

Parameters
node

The node in question

groupNode

The Group node in question

Returns

True or False


boolean vrNodeIsLocal(vrnode node)

Query whether the specified node belongs to the local network user.

Parameters
node

The node to query

Returns

true if the node belongs to the local user


boolean vrNodeIsMetaFiltered(vrnode view,
vrnode node
)

Returns true if the node's meta type is filtered in the specified view.

Parameters
view

The view selection node

node

The node to query the filter state of


void vrNodeRestoreTransform(vrnode node,
boolean recursive
)

Restores the captured transform of a node.

Parameters
node

The node to restore

recursive

True restores all the child transforms too.


Finds the root tree node. This is almost always equivilent to vrTreeRoot.

Parameters
node

The node to get the root of

Returns

The root node


DEPRECATED.


void vrNodeSetLocalMatrix(vrnode node,
string propName,
vrmatrix4 matrix
)

DEPRECATED.


void vrNodeSetLocalPosition(vrnode node,
vrvec3 v,
string prop
)

Sets the local position of the node.

Parameters
node

The node to set the vector on

v

The value to set

prop

The name of the property to set


void vrNodeSetLocalPositionX(vrnode node,
number d,
string prop
)

Sets the local x position of the node.

Parameters
node

The node to set the value on

d

The value to set

prop

The name of the property to set


void vrNodeSetLocalPositionY(vrnode node,
number d,
string prop
)

Sets the local y position of the node.

Parameters
node

The node to set the value on

d

The value to set

prop

The name of the property to set


void vrNodeSetLocalPositionZ(vrnode node,
number d,
string prop
)

Sets the local z position of the node.

Parameters
node

The node to set the value on

d

The value to set

prop

The name of the property to set


void vrNodeSetLocalRotation(vrnode node,
vrvec3 v,
string prop
)

Sets the local rotation of the node.

Parameters
node

The node to set the vector on

v

The value to set

prop

The name of the property to set


void vrNodeSetLocalRotationX(vrnode node,
number d,
string prop
)

Sets the local x rotation of the node.

Parameters
node

The node to set the value on

d

The value to set

prop

The name of the property to set


void vrNodeSetLocalRotationY(vrnode node,
number d,
string prop
)

Sets the local y rotation of the node.

Parameters
node

The node to set the value on

d

The value to set

prop

The name of the property to set


void vrNodeSetLocalRotationZ(vrnode node,
number d,
string prop
)

Sets the local z rotation of the node.

Parameters
node

The node to set the value on

d

The value to set

prop

The name of the property to set


void vrNodeSetLocalScale(vrnode node,
vrvec3 v,
string prop
)

Sets the local scale of the noed.

Parameters
node

The node to set the vector on

v

The value to set

prop

The name of the property to set


void vrNodeSetLocalScaleX(vrnode node,
number d,
string prop
)

Sets the local x scale of the node.

Parameters
node

The node to set the value on

d

The value to set

prop

The name of the property to set


void vrNodeSetLocalScaleY(vrnode node,
number d,
string prop
)

Sets the local y scale of the node.

Parameters
node

The node to set the value on

d

The value to set

prop

The name of the property to set


void vrNodeSetLocalScaleZ(vrnode node,
number d,
string prop
)

Sets the local z scale of the node.

Parameters
node

The node to set the value on

d

The value to set

prop

The name of the property to set


void vrNodeSetLocalTransform(vrnode node,
string propName,
Any vpos,
Any vrot,
Any vscale
)

DEPRECATED.


void vrNodeSetName(vrnode node,
string newName
)

Sets the name of a node.

Parameters
node

The node to set the name of

newName

The new name for the node


void vrNodeSetNoHistory(vrnode node,
boolean noHistory
)

Specifies whether this node can be recorded in the history for undo/redo operations.

Parameters
node

The node to set the 'no history' flag of

noHistory

Whether the 'no-history' flag should be active, i.e. true if the node should not be recorded.


void vrNodeSetNoSave(vrnode node,
boolean noSave
)

Specifies whether this node can be saved in a VRText/VRNative file.

Parameters
node

The node to set the 'no save' flag of

noSave

Whether the 'no-save' flag should be active, i.e. true if the node should not be saved.


void vrNodeSetNoSimulation(vrnode node,
boolean noSimulation
)

Specifies whether this node should be affected by simulations, such as physics and collision.

Parameters
node

The node to set the 'no simulation' flag of

noSimulation

Whether the 'no simulation' flag should be active, i.e. true if the node should not be simulated.


void vrNodeSetParent(vrnode node,
vrnode parent,
vrnode beforeSibling,
boolean preserveWorldTransform
)

Sets the parent of a node.

Parameters
node

The node to set the parent of

parent

New parent. If this is nil, the parent is cleared, effectively deleting the node from the tree.

beforeSibling

Specifies where to add the node in the parent's list of children, or nil to add it at the end of the list.

preserveWorldTransform

If true, the node's position, rotation and scale in the world will be maintained.


Sets the world position of the node.

Parameters
node

The node to set the vector on

v

The value to set


void vrNodeSetPositionX(vrnode node,
number d
)

Sets the world x position of the node.

Parameters
node

The node to set the x value on

d

The value to set


void vrNodeSetPositionY(vrnode node,
number d
)

Sets the world y position of the node.

Parameters
node

The node to set the y value on

d

The value to set


void vrNodeSetPositionZ(vrnode node,
number d
)

Sets the world z position of the node.

Parameters
node

The node to set the z value on

d

The value to set


void vrNodeSetRelativeTransform(vrnode node,
string propName,
vrnode otherNode,
Any vpos,
Any vrot,
Any vscale
)

Sets the position, rotation and scale of the world transform of a node relative to another.

Parameters
vpos

XYZ Position specified in a table {x, y, z}.

vrot

Euler Rotation specified in a table {x, y, z}.

vscale

XYZ Scale specified in a table {x, y, z}.


Sets the world rotation of the node.

Parameters
node

The node to set the vector on

v

The value to set


void vrNodeSetRotationX(vrnode node,
number d
)

Sets the world x rotation of the node.

Parameters
node

The node to set the x value on

d

The value to set


void vrNodeSetRotationY(vrnode node,
number d
)

Sets the world y rotation of the node.

Parameters
node

The node to set the y value on

d

The value to set


void vrNodeSetRotationZ(vrnode node,
number d
)

Sets the world z rotation of the node.

Parameters
node

The node to set the z value on

d

The value to set


Sets the world scale fo the noed.

Parameters
node

The node to set the vector on

v

The value to set


void vrNodeSetScaleX(vrnode node,
number d
)

Sets the world x scale of the node.

Parameters
node

The node to set the x value on

d

The value to set


void vrNodeSetScaleY(vrnode node,
number d
)

Sets the world y scale of the node.

Parameters
node

The node to set the y value on

d

The value to set


void vrNodeSetScaleZ(vrnode node,
number d
)

Sets the world z scale of the node.

Parameters
node

The node to set the z value on

d

The value to set


void vrNodeSetValue(vrnode node,
string propName,
Any value
)

Sets the value of one of the properties of a node.

Parameters
node

The node to get the property on

propName

The name of the property.

value

The new property value to set. This value type should match the property type.


void vrNodeSetValueByIndex(vrnode node,
number idx,
Any value
)

Sets the value of one of the properties of a node finding the property by its index.

Parameters
node

The node to set the property on

idx

The index of the property

value

The new property value to set. This value type should match the property type.


DEPRECATED.


void vrNodeSetWorldTransform(vrnode node,
string propName,
Any vpos,
Any vrot,
Any vscale
)

DEPRECATED.


Any vrNormalise(Any c)

Returns normalised vector/matrix.

Parameters
c

Vector2 or Vector3 or Mat3 or Mat4

Returns

Normalised vector or matrix depending on the type passed in


void vrOpenNotebookPane(string notebookName,
string paneName
)

Opens the specified pane of the given notebook.

Parameters
notebookName

Specifies the name of the notebook.

paneName

Specifies the name of the pane.


table vrParseJSON(string data)

Parse JSON data into a Lua table.

Parameters
data

JSON data

Returns

The parsed data in Lua tables matching the original JSON structure


table vrParseXML(string xml)

Converts an XML string into a hierarchy of nested LUA tables.

Parameters
xml

The XML to parse

Returns

Table representing the document structure


void vrPasteAsChild(vrnode targetNode)

Pastes the contents of the clipboard as a child to the target node.


void vrPasteAsChildToSelection(vrnode viewSelection)

Pastes the contents of the clipboard as a child to the selection group.


void vrPasteAsLinkToSelection(vrnode selectionGroup,
string targetMetaNodeName,
string targetPropertyName
)

Pastes the nodes on the clipboard as a link into the target property of the specified selection group.


void vrPasteAsSibling(vrnode targetNode)

Pastes the contents of the clipboard as a sibling to the specified node.


void vrPasteAsSiblingToSelection(vrnode selectionGroup)

Pastes the contents of the clipboard as a sibling to the specified selection group.


void vrPastePropagateLink(vrnode selectionGroup,
string targetMetaNodeName,
string targetPropertyName
)

Pastes the nodes on the clipboard as a link into all matching nodes and target properties.


vrplane vrPlane(vrvec3 normal,
number distance
)

Returns a plane.

Parameters
normal

The normal of the plane.

distance

The distance from origin.


Returns a plane created from a matrix.


Returns a plane created from a triangle defined by 3 points.


number vrPlaneGetPointDistance(vrplane plane,
vrvec3 point
)

Returns the distance a point is from the plane. A negative value means that the point is behind the plane. A positive value means the point is in front. A zero means it is on the plane.


boolean vrPlaneLineIntersect(vrplane plane,
vrvec3 point1,
vrvec3 point2
)

Returns whether or not a line made of two points will intersect a plane.

Returns

true if the line intersects the plane


Returns a plane transformed by a matrix.


string vrPluginsDir()

Gets the Visionary Render plugins directory.

Returns

Absolute path to the plugins directory in the application install folder


void vrPolarToDegrees(number degrees,
number minutes,
number seconds
)

Convert polar coordinates to degrees.


number vrPolarToRadians(number degrees,
number minutes,
number seconds
)

Convert polar coordinates to radians.


Pops up the gallery window.


Pops open the property window.

Parameters
view

Selection to display the properties of


DEPRECATED - use vrShowScriptWindow.


DEPRECATED - use vrShowScriptWindow.


Pops up the tools window.


void vrPostCommand(string cmd,
string param,
vrnode user
)

Posts a command to be processed by Visionary Render.

Parameters
cmd

The command to post

param

Parameter to pass to the command

user

User to run the command as (default: local user)


void vrPresentMessage(string msg)

Presents a message box to the user.

Parameters
msg

The message to display


void vrProgressBegin(string/int(optional) msg/ val,
int(optional) max,
string(optional) msg
)

Begins showing the progress display.

Parameters
msg/val

  • When the only argument, string message to display

  • When not the only argument, integer progress value for bar display

max

The maximum range of the progress bar

msg

The message to display


Ends the progress display.


void vrProgressEvents(boolean enabled)

Create Nodes under user tree to indicate when progress events are occuring.

Parameters
enabled

Whether to enable progress messages


void vrProgressYield(string/int(optional) msg/ val,
int(optional) max,
string(optional) msg
)

Updates the progress display.

Parameters
msg/val

  • When the only argument, string message to display

  • When not the only argument, integer progress value for bar display

max

The maximum range of the progress bar

msg

The message to display


Transforms a vector by the inverse of the current projection matrix.

Parameters
viewportNode

Viewport to get the projection matrix from (defaults to local user's default viewport)


Transforms a vector by the current projection matrix.

Parameters
viewportNode

Viewport to get the projection matrix from (defaults to local user's default viewport)


void vrPushRecentFile(string file)

Adds a file to the end of the list of recent files and its folder to the end of the list of recent folders.


void vrPushRecentImportFile(string file)

Adds a file to the end of the list of recent imports and its folder to the end of the list of recent import folders.


Return an identity quaternion.


Returns the dot product of two quaternions.


Return a quaternion constructed from a rotation around an axis.

Parameters
axis

The axis to rotate around.

angle

The angle to rotate by.


Return a quaternion constructed from euler angles.

Parameters
angles

The X, Y and Z angles to construct the quaternion from.


Returns a quaternion constructed from a 4x4 matrix.

Parameters
m

The matrix to construct with (mat3 or mat4).


Returns the linear interpolation between two quaternions.


Returns the spherical interpolation between two quaternions.


vrray vrRay(vrvec3 origin,
vrvec3 dir
)

Returns a ray.

Parameters
origin

The origin of the ray.

dir

The direction the ray is pointing.


number vrRayIntersect(vrplane plane,
vrray ray
)

Returns how far along the ray an intersection point with this plane is.


void vrReleaseObjectFromTrackedHand(vrnode target,
number handIndex,
vrnode user
)

Releases a node attached to the hand. This works in conjunction with vrGrabObjectWithTrackedHand and the TrackedManipulatorTool.

Parameters
target

The node to release, or nil to release all objects from the specified hand(s) (defaults to nil)

handIndex

-1 for any hand, 0, for left hand, 1 for right hand (defaults to -1)

user

The user holding the node, or nil to deduce the user automatically (defaults to nil)


void vrReloadAudio(vrnode node)

Finds audio nodes and reloads the audio data from the associated files.


Recursively finds texture nodes and reloads the texture data from the associated files.

Parameters
node

The node to start searching from. Can be an individual texture node.


void vrRemoveObserver(string key)

Removes an observer.

Parameters
key

The unique key specified when adding the observer.


void vrRemoveRecentItem(string file,
string nodeName
)

Removes a recent file, folder or import from the corresponding list.

Parameters
file

The filename to remove

nodeName

Either 'RecentFiles' or 'RecentFolders'


void vrRemoveTransformLimits(vrnode node,
string type
)

Removes the TransformLimits on a node.

Parameters
node

The node to remove the limits from.

type

The Type of TransformLimit to remove. Arguments are: "Position", "Rotation", "Scale".


string vrRequestFolder(string caption,
string initialDir
)

Invokes a dialog to select a folder.

Parameters
caption

Caption to present on the dialog

initialDir

Path to the initial directory to browse (default: the last directory something was opened from)

Returns

Absolute path to the selected folder


string vrRequestLoadFile(string caption,
string initialDir,
string filterStr,
string defaultExt
)

Invokes a dialog to load a file.

Parameters
caption

Caption to present on the dialog (optional, default: 'Select File')

initialDir

Path to the initial directory to browse (optional, default: the last directory something was opened from)

filterStr

Windows-style file filter string with | in place of null chars (optional, default: 'All Files (*.*)|*.*|'

defaultExt

Default file extension to filter by (optional, no effect when using default filterStr)

Returns

Absolute path to the file selected by the user in the dialog


string vrRequestSaveFile(string caption,
string initialDir,
string filterStr,
string defaultExt,
string defaultFile
)

Invokes a dialog to save a file.

Parameters
caption

Caption to present on the dialog (optional, default: 'Select File')

initialDir

Path to the initial directory to browse. (optional, default: the last directory something was opened from)

filterStr

Windows-style file filter string with | in place of null chars. (optional, default: 'All Files (*.*)|*.*|'

defaultExt

Default file extension to filter by (optional, no effect when using default filterStr)

defaultFile

Default file name to provide in the file name control on the dialog (optional)

Returns

Absolute path to the file selected by the user in the dialog (this file may not exist)


Refreshes the scale of the PRS manipulator.


Resets the windows to their initial positions and states that they were when the application was started.


Restores the captured state of the Lua global environment.


void vrSaveTree(vrnode node,
string file,
boolean newUUID
)

Saves a Visionary Render format file.

Parameters
node

The node to start saving from (use vrTreeRoot for a full scene save)

file

The path to the output file

newUUID

True creates new UUIDs from nodes into the file.


Returns the Scenes node from the tree.


void vrScriptEditorAppendText(string text)

Inserts text into the currently visible script editor tab and advances the insert cursor position.

Parameters
text

text to append


Clears the script editor output.


Copies the selected text in the currently visible script editor tab to the clipboard.


Copies the selected text in the currently visible script editor tab to the clipboard and then erases it.


Deletes a single character from behind the insertion point in the currently visible script editor tab and steps the cursor backwards (backspace behaviour)


Deletes a single character at the insertion point in the currently visible script editor tab and leaves the insertion point where it is (delete behaviour)


Deletes the selected text from the currently visible script editor tab.


number vrScriptEditorFind(string text,
number pos
)

Finds some text in the currently visible script editor tab.

Parameters
text

text to find

pos

character position to start searching from

Returns

The position of the first match


Returns the current line number (zero based) in the currently visible script editor tab.


Gets the text insert cursor position in the currently visible script editor tab.


Gets the text mark cursor position in the currently visible script editor tab.


void vrScriptEditorInsertText(string text)

Inserts text into the currently visible script editor tab.

Parameters
text

text to insert


Reads the clipboard, translates the contents and inserts them at the insertion point in the currently visible script editor tab.


Selects all the text in the currently visible script editor tab.


Selects the word surrounding the current insertion point in the currently visible script editor tab.


void vrScriptEditorSetCurrentLine(number lineNo)

Set the cursor at the start of the specified line in the currently visible script editor tab.

Parameters
lineNo

Line number


Places the text insert cursor in the currently visible script editor tab underneath the mouse cursor.


void vrScriptEditorSetInsertPos(number pos,
string relTo
)

Sets the text insert cursor position in the currently visible script editor tab.

Parameters
pos

Character position in the text

relTo

Specifies where the position is relative to; either 'current', 'start' or 'end'


void vrScriptEditorSetMarkPos(number pos,
string relTo
)

Sets the text mark cursor position in the currently visible script editor tab. This is for highlighting text.

Parameters
pos

Character position in the text

relTo

Specifies where the position is relative to; either 'current', 'start' or 'end'


void vrSearchView(string view,
string searchString
)

Sets the search query for a specified view.

Parameters
view

The name of the view

searchString

The string to insert into the search box


DEPRECATED - use vrSelectNodes.


Navigates to an entry in the selection history.

Returns

The selection group containing the now current selection


vrnode vrSelectNext(number distance)

Navigates to the next selection.

Parameters
distance

Number of steps in the selection history to move

Returns

The selection group containing the now current selection


boolean vrSelectNode(vrnode selectionGroup,
vrnode node
)

Selects a node by adding it to the specified selection group.

Parameters
selectionGroup

The selection group to add to

node

The node to select

Returns

true if the node was selected


vrnode vrSelectNodes(vrnode [] nodes,
string(optional) allowedViews,
boolean(optional) alsoShowProperties
)

Selects the specified array of nodes in the most appropriate view.

Parameters
nodes

Nodes to select. Can be one node or an array of nodes

allowedViews

Views to consider selection in. Can be empty to consider all views. Accepts selection group names

alsoShowProperties

Specifies whether to also display the properties window for the new selection

Returns

The view that the nodes were selected in


vrnode vrSelectPrevious(number distance)

Navigates to the previous selection.

Parameters
distance

Number of steps in the selection history to move

Returns

The selection group containing the now current selection


void vrSetAppQuitHook(string luaFunc)

Specify a lua function to be called when user tries to quit the application.

Parameters
luaFunc

Name of the Lua function. This function should return false if it wants to block the exit.


void vrSetConfigMode(number mode)

Sets the config to the specified mode, if its available.

Parameters
mode

Immersive mode value


void vrSetGUIEnabled(boolean enabled,
vrnode userNode
)

Shows or hides the windows over the 3D scene.

Parameters
userNode

user whose gui should be affected (defaults to local user)


Sets the browser icon for a node to the current view.


Sets the browser icon for a node to the default icon.


void vrSetIconToTexture(vrnode node,
vrnode texture
)

Sets the browser icon for a node to a texture.

Parameters
texture

The texture node


void vrSetScriptIdentifier(string name)

Sets an identifier for the Lua execution.

Parameters
name

Name to identify the current Lua execution


void vrSetScriptTimeout(number time)

Overrides the default Lua timeout for scripts, until the next script event is triggered.

Parameters
time

Number of seconds to wait before timing out. A value of 0 means it never times out.


void vrSetSelectedTreeFrame(string name)

Sets the currently selected tree view frame by name.


void vrSetStatusBar(string text,
number duration
)

Set the text and duration of the text in the status bar.

Parameters
text

Text to display

duration

Number of seconds to display the status message


void vrSettingAddToScene(string path,
Any defaultVal,
Any slot,
Any complete,
string typestr
)

Creates a scene setting as an override to an existing setting or a scene-only setting.

Parameters
path

Path to the setting (relative to the registry root

defaultVal

Default value if the scene setting is not an override

slot

Function to call when the setting value changes

complete

Function to call when the node has been created, which may not be immediately

typestr

Hint at which number type should be used instead of a double to create a scene-only setting (int, float, world)


vrsetting vrSettingGet(string path,
vrnode userNode
)

Gets an application setting from the user registry, or a scene override if it exists.

Parameters
path

Path to the setting (relative to the registry root)

userNode

The user the setting belongs to. If none is specified current user is used


vrsetting vrSettingGetNode(string path,
vrnode userNode
)

Gets an application setting node from the user registry, or a scene override if it exists.

Parameters
path

Path to the setting (relative to the registry root)

userNode

The user the setting belongs to. If none is specified current user is used


Gets the root of the settings overrides in the scenes tree if it exists.

Returns

The scene setting root, or nil


Any vrSettingRead(string path,
vrnode userNode
)

Reads the value of a setting.

Parameters
path

Path to the setting (relative to the registry root

userNode

The user the setting belongs to. If none is specified current user is used


boolean vrSettingRemoveFromScene(string path)

Removes a scene setting.

Returns

true if the setting was removed


void vrSettingWrite(string path,
Any value,
vrnode userNode
)

Writes the value of a setting.

Parameters
path

Path to the setting (relative to the registry root

value

The value to set

userNode

The user setting belongs to. If none is specified current user is used


void vrSetToolEnabled(string toolName,
boolean enabled,
vrnode userNode
)

Sets the Enabled state of a named Tool.


Sets the tracked eye to the specified node.


void vrSetTrackedHandNode(vrnode node,
number index
)

Sets the tracked hand to the specified node.

Parameters
index

0 for left hand, 1 for right hand


void vrSetTransformLimits(vrnode node,
string type,
string limitType,
boolean x,
boolean y,
boolean z
)

Adds transform limits onto a node.

Parameters
node

The node to add the limits to.

type

The Type of TransformLimit to add. Arguments are: "Position", "Rotation", "Scale".

limitType

The Type of constraint to set. Arguments are "Lock", "Limit", "Step".


void vrSetViewportLayout(vrnode viewportLayoutNode,
vrnode userNode
)

Sets the user's current viewport layout.

Parameters
userNode

user whose viewport should be updated (defaults to local user)


Returns true if the camera position should be saved into documents.


DEPRECATED.


void vrShowAnnotationReviewWindow(vrnode annotationNode)

Pops up the applicaiton annotation review window for the specified annotation node.

Parameters
annotationNode

The annotation node to show


void vrShowGalleryType(string typeName)

Shows a type in the gallery window.

Parameters
typeName

Specifies the name of the type to show.


void vrShowGradientWindow(vrnode gradientNode)

Pops up the application gradient editor for the specified gradient node.

Parameters
gradientNode

The gradient node to show


void vrShowGUIFrame(vrnode uiNode,
boolean show
)

Show or hide a GUI frame.

Parameters
uiNode

The frame node

show

True to show, false to hide


void vrShowImporterSettings(vrnode importerNode)

Invokes a dialog that shows the importer settings for the given node.

Parameters
importerNode

Importer node


void vrShowInTree(vrnode node)

DEPRECATED - use vrSelectNodes.


void vrShowInTreeViewFrame(vrnode node,
string view,
vrnode node,
string view
)

DEPRECATED - use vrSelectNodes.


void vrShowNextSelection(number distance)

Navigates to the next selection and shows the properties of the nodes.

Parameters
distance

The number of steps forward in the selection history to go


void vrShowNodeProperties(vrnode selection,
boolean popup
)

Pops up the application property editor for the specified view selection.


void vrShowPreviousSelection(number distance)

Navigates to the previous selection and shows the properties of the nodes.

Parameters
distance

The number of steps back in the selection history to go


void vrShowPropertyWindow(vrnode selection,
boolean popup
)

Pops up the application property editor for the specified view selection.

Parameters
selection

The selection group to show properties for

popup

True if the properties window should be shown if currently hidden


void vrShowScriptWindow(vrnode scriptNode)

Pops up the application script editor for the specified script node.

Parameters
scriptNode

The script node to show


void vrShowSequence(vrnode selection)

Shows the specified sequence in the sequencer window.


void vrShowSequencer(vrnode selection)

Shows the sequencer window.

Parameters
selection

The sequence node to show


void vrShowSettingsWindow(vrnode selection,
number tabIndex
)

Pops up the application settings for the specified settings group.

Parameters
selection

The setting category node to show

tabIndex

Zero-indexed tab number to show


number vrSmoothStep(number a,
number b,
number x
)

Return a smoothly interpolated value between A and B.

Parameters
a

The lowest value.

b

The highest value.

x

How much to interpolate.


void vrSnapshotApply(vrnode snapNode)

Applies the specified snapshot.


vrsphere vrSphere(vrvec3 position,
number radius
)

Returns a sphere.

Parameters
position

The center of the sphere.

radius

The radius of the sphere.


vrsphere vrSphereMerge(Any left,
vrsphere right
)

Returns a sphere that encapsulates two spheres.


vrsphere vrSphereTransform(Any sphere,
vrmatrix4 matrix
)

Returns a sphere transformed by a matrix.


MULTI< string, string, string > vrSplitFilePath(string path)

Returns file directory, name, and extension.

Parameters
path

Relative or absolute path to test

Returns

File Directory

File Name

File Extension


table vrSubDirs(string path)

Gets the subdirectories of a directory.

Parameters
path

Path to the directory to scan

Returns

Array of subdirectory names


void vrSuspendDynamics(vrnode node,
boolean onOff
)

Enables or disables dynamics.


Returns the SystemsLib node from the tree.


boolean vrTestContain(Any a,
Any b
)

Returns whether or object A completly contains object B.

Parameters
a

A sphere or AABB

b

A sphere, AABB, or vec3

Returns

true if b is inside a


boolean vrTestIntersection(Any a,
Any b
)

Returns whether or not two objects are intersecting one another.

Parameters
a

A sphere or AABB

b

A sphere or AABB

Returns

True if the objects are intersecting


void vrToggleGUIEnabled(vrnode userNode)

Toggles the visibility of the windows over the 3D scene.

Parameters
userNode

user whose gui should be affected (defaults to local user)


boolean vrToggleNotebookPane(string notebookName,
string paneName
)

If the current pane is visible it will be hidden, if it's hidden it will be made visible (and selected).

Parameters
notebookName

Specifies the name of the notebook.

paneName

Specifies the name of the pane.

Returns

true if the pane is set to visible


Toggles the current viewport between perspective and orthographic views.


Toggles the subtree stats display in the properties window.


void vrToggleToolEnabled(string toolName,
vrnode userNode
)

Toggles the Enabled state of a named Tool.


Gets the first assembly currently under the tracked cursor.


Transforms a vector by the world rotation of the node.


Selects or deselects all nodes between the specified node and the last selected node without affecting the rest of the selection.

Returns

The selection container that the selection was made in


Selects (or deselects the currently selected) node without affecting the rest of the selection.

Returns

The selection container that the selection was made in


Selects all nodes between the specified node and the last selected node.

Returns

The selection container that the selection was made in


Returns the root node.


table vrTreeSearch(vrnode startNode,
string searchQuery
)

Searches the tree and returns a table of results matching the query.

Parameters
startNode

The node to start searching from

searchQuery

A query in the format [and|or] [name|type|type.prop] [equals|not|contains] (see the Advanced Query section of the user manual for further information).

Returns

Array of nodes matching the search query


Selects the specified node in the specified view (or any view if nil).

Returns

The selection container that the selection was made in


void vrTreeViewSelectionCollapse(string view)

Collapses the current selection.

Parameters
view

The name of the view


Collapses the current selection and its descendants.

Parameters
view

The name of the view


void vrTreeViewSelectionExpand(string view)

Expands the current selection.

Parameters
view

The name of the view


void vrTreeViewSelectionExpandAll(string view)

Expands the current selection and its descendants.

Parameters
view

The name of the view


Selects all siblings.

Parameters
view

The name of the view


Selects children.

Parameters
view

The name of the view


Inverts selection.

Parameters
view

The name of the view


Selects parent(s) of the current selection.

Parameters
view

The name of the view


Selects siblings (of same type).

Parameters
view

The name of the view


void vrTriggerRename(string view,
vrnode node
)

Triggers a node rename in the tree view.

Parameters
view

The name of the view

node

The node to rename


void vrUnloadPlugin(string pluginInfo)

void vrUpdateMenu(vrnode uinode)

Create menu item frames for children of the menu node.

Parameters
uinode

The menu node parent


Updates a menu to display the current selection history.


Gets the current user's documents directory.

Returns

Absolute path to the user's Visionary Render documents folder


Gets the current applications users plug-ins directory.

Returns

Absolute path to the plugins directory in the user's documents folder


Returns the 'Users' node from the tree.


boolean vrUsingHMD()

Returns whether or not we are using a HMD.


vec2 vrVec2(number x,
number y
)

Returns a 2 dimensional vector.

Parameters
x

The X component of the resulting vector

y

The Y component of the resulting vector


vrvec3 vrVec3(number x,
number y,
number z
)

Returns a 3 dimensional vector.

Parameters
x

The X component of the resulting vector

y

The Y component of the resulting vector

z

The Z component of the resulting vector


vrvec4 vrVec4(number x,
number y,
number z,
number w
)

Returns a 4 dimensional vector.

Parameters
x

The X component of the resulting vector

y

The Y component of the resulting vector

z

The Z component of the resulting vector

w

The W component of the resulting vector


Transforms a vector by the inverse of the current view matrix.

Parameters
viewportNode

Viewport to get the view matrix from (defaults to local user's default viewport)


Transforms a vector by the current view matrix.

Parameters
viewportNode

Viewport to get the view matrix from (defaults to local user's default viewport)


void vrWitnessSetMaterial(vrnode target,
vrnode material
)

INTERNAL.


void vrWitnessSetModel(vrnode target,
vrnode model
)

INTERNAL.


void vrWitnessSetSequencePos(vrnode target,
string sequence,
number position
)

INTERNAL.


void vrYield(number time)

Yields the Lua execution back to the application for the (approximate) specified time.

Parameters
time

Number of seconds before resuming execution of this script, or 0 for one frame


void vrZoomTrackView(number delta)

INTERNAL.

No Results.

Getting StartedArchitectureBest PracticesHow ToAdvanced TopicsChangelogvrtree_cppCoreForeign Function InterfaceMetanodesMigrationsObserversPropertiesTreeUtilitiesAPI DefinitionsVR ExchangePluginsLua API