Skip to main content

Core

Core functions and types that can be used by Lua scripts and plugins.

Classes​

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

Functions​

TypeName
voidvrActivate(vrnode Self, vrnode Other =nil)
Invokes the Activate event of a Node optionally setting the __Other register.
voidvrAppCommandAdd(string commandName)
Adds an app command and binds a lua function call to it.
voidvrAppCommandBind(string commandName, Any func)
Binds a lua function to an app command.
stringvrAppDir()
Gets the Visionary Render application directory.
voidvrArrange(vrnode targetNode, string type)
Arranges assemblies into a grid based on their bounds.
booleanvrBakeMesh(vrnode targetNode)
Converts deformable meshes to static meshes for export and upload.
voidvrBuildCurveViewConfig(number radius, number angle, number height, number segments, boolean smoothCurve, vrnode user =nil, vrnode camera, vrnode screens =nil, vrnode viewportLayout)
Creates or updates the PhysicalScreen and Viewport nodes for a curved screen.
booleanvrCanCompressTexture(vrnode node)
Determines whether DXT compression can be applied to a texture.
booleanvrCanScaleTexture(vrnode node)
Determines whether a texture can be scaled.
voidvrCaptureCleanState()
Captures the current state of the Lua global environment.
voidvrCaptureViewpoint(vrnode viewpoint, number size, string captureComplete, string textureCreate =0)
Captures the view from a specified viewpoint into a texture.
booleanvrClearSelection(vrnode selectionGroup)
Clears the selection in the specified selection group.
voidvrClusterMaster()
Returns true if the local user is a cluster master.
voidvrClusterSlave()
Returns true if the local user is a cluster slave.
voidvrCompressTexture(vrnode node)
Applies DXT compression to a texture.
booleanvrConfigModeAvailable(number mode =CM_MODE_COUNT)
Returns true or false if the specified mode is available.
voidvrConstrainNodeToBounds(vrnode node =nil, vrbox bbox =nil)
Constrains a node with a TransformLimit to a bounding box.
voidvrControlManikinJoints(vrnode manikin, boolean controlRemotely, vrnode user)
Take control of a manikin's joints with a specified user (or local user if none specified).
voidvrControlManikinTargets(vrnode manikin, boolean controlRemotely, vrnode user)
Take control of a manikin with a specified user (or local user if none specified).
voidvrCopyBitmap(vrnode node)
Copies the texture data from a node onto the Windows clipboard.
voidvrCopySelectionToClipboard(vrnode selectionToCopy)
Copies the specified selection group to the clipboard.
voidvrCopyToClipboard(vrnode nodeToCopy)
Copies the specified node to the clipboard.
voidvrCreateGradient()
Creates a new gradient.
voidvrCreateSequence()
Adds a child sequence to a selected node or the Scenes node.
vrnodevrCreateShape(string type, vrnode parent)
Creates a new shape and attaches it to a parent node.
vrnodevrCreateShapeData(string type, vrnode parent)
Creates vertex and index nodes of a shape and adds them to the Mesh node passed in.
vrnodevrCreateViewpoint(vrnode parent =nil, string name =0)
Creates a viewpoint at the current camera position.
voidvrCursorGetTouchedAssembly()
Gets the first assembly currently under the mouse cursor.
voidvrCursorGetTouchedGeoGroup()
Gets the first geogroup currently under the mouse cursor.
voidvrCursorGetTouchedModel()
Gets the first model currently under the mouse cursor.
voidvrCursorGetTouchedVisual()
Gets the first visual currently under the mouse cursor.
voidvrCursorIgnoreNode(vrnode node, boolean ignore)
Makes the specified node unpickable with the cursor.
stringvrDataFile(string path)
Gets the specified file path from the Visionary Render application data directory, or an empty string if it does not exist.
voidvrDisableNetwork()
Disables networking capabilities.
voidvrEnableNetwork()
Enables networking capabilities.
voidvrEnableNodeWhenConfigModeAvailable(vrnode node, number mode =CM_MODE_COUNT)
Makes a button available when the specified mode is avaliable.
voidvrEnableNodeWhenOculusAvailable(vrnode node)
Makes a button available when an Oculus Rift is connected. Note: this function is for the legacy Oculus mode without Touch controllers.
voidvrEnableNodeWhenOculusTouchAvailable(vrnode node)
Makes a button available when an Oculus Touch is connected.
voidvrEnableNodeWhenOpenVRAvailable(vrnode node)
Makes a button available when an OpenVR HMD is connected.
voidvrEnableNodeWhenZSpaceAvailable(vrnode node)
Makes a button available when a zSpace device is detected.
voidvrExtractBinaryAssets(vrnode fromNode, string path, boolean overwrite =true, ...)
Extracts binary data from Texture or AudioBuffer nodes.
booleanvrFileExists(string path)
Returns true if the specified file exists.
voidvrFindAndOptimizeModels(vrnode node)
Finds and optimises model nodes.
booleanvrFolderExists(string path)
Returns true if the specified folder exists.
voidvrForkApp()
Forks the application into another process.
voidvrGenerateQRCodeFile(string content, string filename, number border =4, number pixelsPerModule =32, number errorCorrection =0)
Generates a QR code and saves it to a file.
voidvrGenLightning()
Generates a lightning polyline.
vrnodevrGetActivatorNode()
Gets the node which activated the event.
MULTI< boolean, string >vrGetAllDocHelp(boolean doxyFormat =false, string outputPath =0)
Gets the entire Lua API reference, either to a string or a file.
vrnodevrGetClipboardNode()
Returns the node containing the clipboard content, or nil if nothing is on the clipboard.
booleanvrGetCommandLineSwitch(string name)
Returns whether or not a command line switch was specified.
stringvrGetCommandLineSwitchValue(string name)
Returns the value of a command line switch.
tablevrGetContactPoints(vrnode nodeA, vrnode nodeB)
Returns a list of contact points and normals between two nodes.
vrvec3vrGetCursorPosition()
Get the mouse cursor's current position.
tablevrGetDirectoryContents(string path, string filter, boolean includeFolders, boolean includeFiles)
Gets the contents of a directory.
voidvrGetGradientColourAt(vrnode gradientNode, number value)
Gets the gradient colour (as RGB value) at the specified position.
vrnodevrGetHoldingUser(vrnode node)
Return the user that is holding the node.
vrnodevrGetIconsLibrary(boolean create =true)
Gets the library in which browser icons are stored.
tablevrGetImporterFileExtensions(string importerName)
Gets the file extensions associated with an importer plugin.
tablevrGetImporterList()
Gets the names of all installed data importer plugins.
vrvec3vrGetLastClickedCursorPosition(vrnode user =nil)
Get the position of the cursor when the mouse was last clicked.
stringvrGetLastOpenDir()
Returns the last directory selected.
vrnodevrGetLastViewSelectionGroup()
Returns the selection group that was added to.
tablevrGetRecentFileList()
Returns the list of recent files.
tablevrGetRecentFolderList()
Returns the list of recent folders.
tablevrGetRecentImportFileList()
Returns the list of recent import files.
tablevrGetRecentImportFolderList()
Returns the list of recent import folders.
vrnodevrGetTrackedEyeNode()
Gets the current tracked eye node.
vrnodevrGetTrackedHandNode(number index =-1)
Gets the current tracked hand node.
vrvec3vrGetUserOffset(boolean world =true, boolean atHeadHeight =false)
Gets the offset from the body to the user's standing position.
vrnodevrGetViewportLayout(vrnode userNode =nil)
Gets the user's current viewport layout.
stringvrGetVisRenRevision()
Returns the revision number of Visionary Render being used.
stringvrGetVisRenVersion()
Returns the version number of Visionary Render being used.
voidvrGrabObjectWithTrackedHand(vrnode target, boolean moveToHand =true, boolean rotateToHand =true, boolean scaleToHand =true, boolean releaseOthers =true, number handIndex =-1, vrnode user =nil)
Attaches a target node to the hand.
voidvrGroupAddMember(vrnode groupNode, vrnode memberNode)
Adds a node to the specified group.
voidvrGroupHasNodeOfType(vrnode groupNode, string metaType)
Checks whether a group contains a node of a specified type.
voidvrGroupRemoveMember(vrnode groupNode, vrnode memberNode)
Removes a node from the specified group.
vrnodevrGroupSnapshot(vrnode groupNode, vrnode snapNode)
Creates a snapshot of the specified group.
vrnodevrGroupsRoot(boolean noCreate =false)
Gets the Groups root node under the Scenes tree.
voidvrHasLicenceFeature(string featureName)
Checks whether a licence feature is available.
booleanvrHasPermission(string permission, vrnode originatorNode =nil)
Queries whether or not we have a named permission.
voidvrHistoryAddMark()
Adds an undo point in to the History.
voidvrHistoryClear()
Erases the undo history.
voidvrHistoryStepBack()
Undoes the history to the previous history mark.
voidvrHistoryStepForward()
Redoes the history to the next history mark.
voidvrImportAssetLibrary(string file)
Imports an asset library.
voidvrIsClustered()
Returns true if running in a cluster configuration.
voidvrIsDebugBuild()
Returns true if the DEBUG compilation flag was defined.
booleanvrIsStereoAvailable(number mode =0)
Returns true if stereo 3D is available in the current instance of Visionary Render.
booleanvrIsSystemNode(vrnode node)
Returns true if the system node is an ancestor of node.
booleanvrIsToolEnabled(string toolName, vrnode userNode =nil)
Tests whether a named Tool is enabled.
booleanvrIsTrackingEnabled()
Gets the enabled state of the user's tracking.
booleanvrLaunchProcess(string cmdline, boolean pipeOutput =false, number timeout =0.0)
Launches a command or application asynchronously.
voidvrLinkNetwork(string host, number port)
Links to another application instance forming a Peer-To-Peer network.
stringvrListExports()
List all Lua VR extension functions.
voidvrLoadAvatarFromFile(vrnode parent, string filename)
Loads an avatar from a file and places it as a child to parent node.
voidvrLoadAvatarFromFileToEdit(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.
voidvrLoadPlugin(string pluginName, string pluginVersion, string pluginInternalName, string pluginDir)
vrnodevrLocalUserNode()
Returns the local user's node.
vrnodevrMakeArrow(vrnode parent, string name, number length, number width, number centreBias)
Creates an arrow shape.
vrnodevrMakeBox(vrnode parent, string name, number width, number height, number depth, number stacks, number slices, boolean reverseWinding)
Creates a box shape.
vrnodevrMakeCylinder(vrnode parent, string name, number bottomRadius, number topRadius, number height, number stacks, number slices, boolean reverseWinding)
Creates a cylinder shape.
vrnodevrMakeEllipsoid(vrnode parent, string name, number radiusX, number radiusY, number radiusZ, number stacks, number slices, boolean reverseWinding)
Creates an ellipsoid shape.
vrnodevrMakePlane(vrnode parent, string name, number hsize, number vsize, number stacks, number slices, boolean reverseWinding, boolean doubleSided)
Creates a plane shape.
vrnodevrMakeTorus(vrnode parent, string name, number radius, number rez, number ringRadius, number ringRez)
Creates a torus shape.
booleanvrModifierPressed(number id)
Tests whether any modifier keys are pressed.
voidvrNetworkSetRetryConnect(boolean allowRetry)
Sets whether failed calls to vrLinkNetwork should retry until the user manually aborts them.
tablevrParseJSON(string data)
Parse JSON data into a Lua table.
tablevrParseXML(string xml)
Converts an XML string into a hierarchy of nested LUA tables.
stringvrPluginsDir()
Gets the Visionary Render plugins directory.
voidvrPostCommand(string cmd, string param =0, vrnode user =nil)
Posts a command to be processed by Visionary Render.
voidvrPrimaryUserNode()
Returns the cluster master's user node, or the local user node if unclustered.
voidvrPushRecentFile(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.
voidvrPushRecentImportFile(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.
voidvrReleaseManikin(vrnode manikinOrUser)
Releases a manikin from the user who is controlling it.
voidvrReleaseObjectFromTrackedHand(vrnode target =nil, number handIndex =-1, vrnode user =nil)
Releases a node attached to the hand. This works in conjunction with vrGrabObjectWithTrackedHand and the TrackedManipulatorTool.
voidvrReloadAudio(vrnode node)
Finds audio nodes and reloads the audio data from the associated files.
voidvrReloadTextures(vrnode node)
Recursively finds texture nodes and reloads the texture data from the associated files.
voidvrRemoveRecentItem(string file, string nodeName)
Removes a recent file, folder or import from the corresponding list.
voidvrRescalePRSManipulator()
Refreshes the scale of the PRS manipulator.
voidvrScaleTexture(vrnode node, number scaleX, number scaleY =0.0)
Scales a texture by the specified factor.
voidvrSetConfigMode(number mode =CM_MODE_COUNT)
Sets the config to the specified mode, if its available.
voidvrSetToolEnabled(string toolName, boolean enabled, vrnode userNode =nil)
Sets the Enabled state of a named Tool.
voidvrSetTrackedEyeNode(vrnode node =nil)
Sets the tracked eye to the specified node.
voidvrSetTrackedHandNode(vrnode node =nil, number index =1)
Sets the tracked hand to the specified node.
voidvrSetViewportLayout(vrnode viewportLayoutNode, vrnode userNode =nil)
Sets the user's current viewport layout.
booleanvrShouldSaveCamera()
Returns true if the camera position should be saved into documents.
voidvrSnapshotApply(vrnode snapNode)
Applies the specified snapshot.
MULTI< string, string, string >vrSplitFilePath(string path)
Returns file directory, name, and extension.
voidvrSplitVirtalisHubURL(string url)
Identifies a Virtalis Hub URL and splits out the server name, artifact ID and artifact name.
tablevrSubDirs(string path)
Gets the subdirectories of a directory.
voidvrToggleProjection()
Toggles the current viewport between perspective and orthographic views.
voidvrToggleToolEnabled(string toolName, vrnode userNode =nil)
Toggles the Enabled state of a named Tool.
voidvrTrackedCursorGetTouchedAssembly(number index)
Gets the first assembly currently under the tracked cursor.
voidvrUnloadPlugin(string pluginInfo)
Unloads the specified plugin.
stringvrUserDocumentsDir()
Gets the current user's documents directory.
stringvrUserPluginsDir()
Gets the current applications users plug-ins directory.
booleanvrUsingHMD()
Returns whether or not we are using a HMD.

Functions Documentation​

vrActivate​

void vrActivate(
vrnode Self,
vrnode Other =nil
)

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

vrAppCommandAdd​

void vrAppCommandAdd(
string commandName
)

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

vrAppCommandBind​

void vrAppCommandBind(
string commandName,
Any func
)

Binds a lua function to an app command.

vrAppDir​

string vrAppDir()

Gets the Visionary Render application directory.

Return: Absolute path to the folder containing visren-app.exe

vrArrange​

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

vrBakeMesh​

void vrBakeMesh(
vrnode targetNode
)

Converts deformable meshes to static meshes for export and upload.

Parameters:

  • targetNode The node of the visual you want to convert

Return: true if the conversion was successful.

vrBuildCurveViewConfig​

void vrBuildCurveViewConfig(
number radius,
number angle,
number height,
number segments,
boolean smoothCurve,
vrnode user =nil,
vrnode camera,
vrnode screens =nil,
vrnode viewportLayout
)

Creates or updates the PhysicalScreen and Viewport nodes for a curved screen.

Parameters:

  • radius The radius of the curve in metres
  • angle The curvature of the screen in degrees
  • height The height of the screen in metres
  • segments The number of viewports to split the curve into
  • smoothCurve Whether to apply distortion to wrap the image onto a smoothly curved screen, or leave the segments facetted
  • user The user to create the configuration for

vrCanCompressTexture​

boolean vrCanCompressTexture(
vrnode node
)

Determines whether DXT compression can be applied to a texture.

Parameters:

  • node vrnode The texture to compress

Return: true if the texture can be compressed

vrCanScaleTexture​

boolean vrCanScaleTexture(
vrnode node
)

Determines whether a texture can be scaled.

Parameters:

  • node vrnode The texture to scale

Return: true if the texture can be scaled

vrCaptureCleanState​

void vrCaptureCleanState()

Captures the current state of the Lua global environment.

vrCaptureViewpoint​

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

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

vrClearSelection​

boolean vrClearSelection(
vrnode selectionGroup
)

Clears the selection in the specified selection group.

Parameters:

  • selectionGroup The selection group to clear

Return: true if the selection was cleared

vrClusterMaster​

void vrClusterMaster()

Returns true if the local user is a cluster master.

vrClusterSlave​

void vrClusterSlave()

Returns true if the local user is a cluster slave.

vrCompressTexture​

void vrCompressTexture(
vrnode node
)

Applies DXT compression to a texture.

Parameters:

  • node vrnode The texture to compress

vrConfigModeAvailable​

boolean vrConfigModeAvailable(
number mode =CM_MODE_COUNT
)

Returns true or false if the specified mode is available.

Parameters:

  • mode Immersive mode value

Return: true if the mode is available

vrConstrainNodeToBounds​

void vrConstrainNodeToBounds(
vrnode node =nil,
vrbox bbox =nil
)

Constrains a node with a TransformLimit to a bounding box.

Parameters:

  • node The node to Constrain

vrControlManikinJoints​

void vrControlManikinJoints(
vrnode manikin,
boolean controlRemotely,
vrnode user
)

Take control of a manikin's joints with a specified user (or local user if none specified).

Parameters:

  • manikin The manikin whose joints to take control of
  • controlRemotely Whether to control the manikin remotely by not locking the camera to its position
  • user The user who will take control of the manikin (local user if none specified)

vrControlManikinTargets​

void vrControlManikinTargets(
vrnode manikin,
boolean controlRemotely,
vrnode user
)

Take control of a manikin with a specified user (or local user if none specified).

Parameters:

  • manikin The manikin to take control of
  • controlRemotely Whether to control the manikin remotely by not locking the camera to its position
  • user The user who will take control of the manikin (local user if none specified)

vrCopyBitmap​

void vrCopyBitmap(
vrnode node
)

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

Parameters:

  • node Texture node to copy

vrCopySelectionToClipboard​

void vrCopySelectionToClipboard(
vrnode selectionToCopy
)

Copies the specified selection group to the clipboard.

vrCopyToClipboard​

void vrCopyToClipboard(
vrnode nodeToCopy
)

Copies the specified node to the clipboard.

vrCreateGradient​

void vrCreateGradient()

Creates a new gradient.

vrCreateSequence​

void vrCreateSequence()

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

vrCreateShape​

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

Return: The new assembly node referencing the new shape model

vrCreateShapeData​

vrnode vrCreateShapeData(
string type,
vrnode parent
)

Creates vertex and index nodes of a shape and adds them to the Mesh node passed in.

Parameters:

  • type Type of shape to create:

  • plane

  • cube

  • sphere

  • cubicsphere

  • disc

  • cone

  • cylinder

  • arrow

  • torus

  • knot

    • parent Mesh node onto which the data should be added

Return: The Mesh node passed in

vrCreateViewpoint​

vrnode vrCreateViewpoint(
vrnode parent =nil,
string name =0
)

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

Return: The new viewpoint node

vrCursorGetTouchedAssembly​

void vrCursorGetTouchedAssembly()

Gets the first assembly currently under the mouse cursor.

vrCursorGetTouchedGeoGroup​

void vrCursorGetTouchedGeoGroup()

Gets the first geogroup currently under the mouse cursor.

vrCursorGetTouchedModel​

void vrCursorGetTouchedModel()

Gets the first model currently under the mouse cursor.

vrCursorGetTouchedVisual​

void vrCursorGetTouchedVisual()

Gets the first visual currently under the mouse cursor.

vrCursorIgnoreNode​

void vrCursorIgnoreNode(
vrnode node,
boolean ignore
)

Makes the specified node unpickable with the cursor.

Parameters:

  • ignore True makes it unpickable, false makes it pickable.

vrDataFile​

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

Return: Absolute path to the specified data file

vrDisableNetwork​

void vrDisableNetwork()

Disables networking capabilities.

vrEnableNetwork​

void vrEnableNetwork()

Enables networking capabilities.

vrEnableNodeWhenConfigModeAvailable​

void vrEnableNodeWhenConfigModeAvailable(
vrnode node,
number mode =CM_MODE_COUNT
)

Makes a button available when the specified mode is avaliable.

Parameters:

  • node Button node to enable
  • mode Immersive mode value

vrEnableNodeWhenOculusAvailable​

void vrEnableNodeWhenOculusAvailable(
vrnode node
)

Makes a button available when an Oculus Rift is connected. Note: this function is for the legacy Oculus mode without Touch controllers.

Parameters:

  • node Button node to enable

vrEnableNodeWhenOculusTouchAvailable​

void vrEnableNodeWhenOculusTouchAvailable(
vrnode node
)

Makes a button available when an Oculus Touch is connected.

Parameters:

  • node Button node to enable

vrEnableNodeWhenOpenVRAvailable​

void vrEnableNodeWhenOpenVRAvailable(
vrnode node
)

Makes a button available when an OpenVR HMD is connected.

Parameters:

  • node Button node to enable

vrEnableNodeWhenZSpaceAvailable​

void vrEnableNodeWhenZSpaceAvailable(
vrnode node
)

Makes a button available when a zSpace device is detected.

Parameters:

  • node Button node to enable

vrExtractBinaryAssets​

void vrExtractBinaryAssets(
vrnode fromNode,
string path,
boolean overwrite =true,
...
)

Extracts binary data from Texture or AudioBuffer nodes.

Parameters:

  • fromNode The node to extract from - may be a single node or a library to search
  • path Directory or file to save data to
  • overwrite Whether to overwrite existing files on disk
  • ... Types to search for ('Texture' or 'AudioBuffer'); only required if fromNode is a different type

vrFileExists​

boolean vrFileExists(
string path
)

Returns true if the specified file exists.

Parameters:

  • path Relative or absolute path to test

Return: True if the file exists

vrFindAndOptimizeModels​

void vrFindAndOptimizeModels(
vrnode node
)

Finds and optimises model nodes.

vrFolderExists​

boolean vrFolderExists(
string path
)

Returns true if the specified folder exists.

Parameters:

  • path Relative or absolute path to test

Return: True if the folder exists

vrForkApp​

void vrForkApp()

Forks the application into another process.

vrGenerateQRCodeFile​

void vrGenerateQRCodeFile(
string content,
string filename,
number border =4,
number pixelsPerModule =32,
number errorCorrection =0
)

Generates a QR code and saves it to a file.

Parameters:

  • content The content of the QR code
  • filename Where to save the generated QR code
  • border The border size in modules, between 0 and 16 (optional, default: 4)
  • pixelsPerModule The number of image pixels per module of the QR code, between 1 and 64 (optional, default: 32)
  • errorCorrection The minimum level of error correction to include, between 0 (low) and 3 (high) (optional, default: 0)

vrGenLightning​

void vrGenLightning()

Generates a lightning polyline.

vrGetActivatorNode​

vrnode vrGetActivatorNode()

Gets the node which activated the event.

vrGetAllDocHelp​

MULTI< boolean, string > vrGetAllDocHelp(
boolean doxyFormat =false,
string outputPath =0
)

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

Return:

  • Success status
  • Lua API Documentation

vrGetClipboardNode​

vrnode vrGetClipboardNode()

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

vrGetCommandLineSwitch​

boolean vrGetCommandLineSwitch(
string name
)

Returns whether or not a command line switch was specified.

Parameters:

  • name The name of the command line switch

Return: True if the command line option is present

vrGetCommandLineSwitchValue​

string vrGetCommandLineSwitchValue(
string name
)

Returns the value of a command line switch.

Parameters:

  • name The name of the command line switch

vrGetContactPoints​

table vrGetContactPoints(
vrnode nodeA,
vrnode nodeB
)

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

Return: Array of contact information.

vrGetCursorPosition​

vrvec3 vrGetCursorPosition()

Get the mouse cursor's current position.

Return: World position of the mouse cursor

vrGetDirectoryContents​

table vrGetDirectoryContents(
string path,
string filter,
boolean includeFolders,
boolean includeFiles
)

Gets the contents of a directory.

Parameters:

  • path Path to the directory to scan
  • filter A list of filters separated by '|', e.g. '*.jpg|*.png' [default: nil]
  • includeFolders Should folders be included in the results [default: false]
  • includeFiles Should files be included in the results [default: true]

Return: A table of tables where each subtable contains details of one file/folder in the specified directory: 'name', 'path', 'size' and 'isFolder'

vrGetGradientColourAt​

void vrGetGradientColourAt(
vrnode gradientNode,
number value
)

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

vrGetHoldingUser​

vrnode vrGetHoldingUser(
vrnode node
)

Return the user that is holding the node.

Parameters:

  • node The node that is being held

Return: The user that is holding the object

vrGetIconsLibrary​

vrnode vrGetIconsLibrary(
boolean create =true
)

Gets the library in which browser icons are stored.

Parameters:

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

vrGetImporterFileExtensions​

table vrGetImporterFileExtensions(
string importerName
)

Gets the file extensions associated with an importer plugin.

Return: Array of file extension names

vrGetImporterList​

table vrGetImporterList()

Gets the names of all installed data importer plugins.

Return: Array of importer names

vrGetLastClickedCursorPosition​

vrvec3 vrGetLastClickedCursorPosition(
vrnode user =nil
)

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.

Return: World position where the mouse was last clicked

vrGetLastOpenDir​

string vrGetLastOpenDir()

Returns the last directory selected.

vrGetLastViewSelectionGroup​

vrnode vrGetLastViewSelectionGroup()

Returns the selection group that was added to.

vrGetRecentFileList​

table vrGetRecentFileList()

Returns the list of recent files.

Return: Array of paths to recently opened files

vrGetRecentFolderList​

table vrGetRecentFolderList()

Returns the list of recent folders.

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

vrGetRecentImportFileList​

table vrGetRecentImportFileList()

Returns the list of recent import files.

Return: Array of paths to files that have recently been imported

vrGetRecentImportFolderList​

table vrGetRecentImportFolderList()

Returns the list of recent import folders.

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

vrGetTrackedEyeNode​

vrnode vrGetTrackedEyeNode()

Gets the current tracked eye node.

vrGetTrackedHandNode​

vrnode vrGetTrackedHandNode(
number index =-1
)

Gets the current tracked hand node.

Parameters:

  • index -1 or nil for default, 0, for left hand, 1 for right hand

vrGetUserOffset​

vrvec3 vrGetUserOffset(
boolean world =true,
boolean atHeadHeight =false
)

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

vrGetViewportLayout​

vrnode vrGetViewportLayout(
vrnode userNode =nil
)

Gets the user's current viewport layout.

Parameters:

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

vrGetVisRenRevision​

string vrGetVisRenRevision()

Returns the revision number of Visionary Render being used.

vrGetVisRenVersion​

string vrGetVisRenVersion()

Returns the version number of Visionary Render being used.

Return: Version string formatted Major.Minor.Patch

vrGrabObjectWithTrackedHand​

void vrGrabObjectWithTrackedHand(
vrnode target,
boolean moveToHand =true,
boolean rotateToHand =true,
boolean scaleToHand =true,
boolean releaseOthers =true,
number handIndex =-1,
vrnode user =nil
)

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
  • rotateToHand Whether to match the rotation of the grabbed object to the hand
  • scaleToHand Whether to match the scale of the grabbed object to the hand
  • releaseOthers Whether to release any other objects that were in the hand
  • handIndex -1 or nil for default, 0, for left hand, 1 for right hand
  • user The user whose hand the object should be attached to, or nil for the current user

vrGroupAddMember​

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

vrGroupHasNodeOfType​

void vrGroupHasNodeOfType(
vrnode groupNode,
string metaType
)

Checks whether a group contains a node of a specified type.

Parameters:

  • groupNode The group node
  • metaType The type of node to find

vrGroupRemoveMember​

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

vrGroupSnapshot​

vrnode vrGroupSnapshot(
vrnode groupNode,
vrnode snapNode
)

Creates a snapshot of the specified group.

Parameters:

  • groupNode The group node
  • snapNode The existing snapshot node that will be replaced if specified [default: nil]

Return: The snapshot node that was created/updated

vrGroupsRoot​

vrnode vrGroupsRoot(
boolean noCreate =false
)

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

vrHasLicenceFeature​

void vrHasLicenceFeature(
string featureName
)

Checks whether a licence feature is available.

Parameters:

  • featureName The name of the licence feature

vrHasPermission​

boolean vrHasPermission(
string permission,
vrnode originatorNode =nil
)

Queries whether or not we have a named permission.

Parameters:

  • permission The permission to query
  • originatorNode The originator

Return: true if the permission is present

vrHistoryAddMark​

void vrHistoryAddMark()

Adds an undo point in to the History.

vrHistoryClear​

void vrHistoryClear()

Erases the undo history.

vrHistoryStepBack​

void vrHistoryStepBack()

Undoes the history to the previous history mark.

vrHistoryStepForward​

void vrHistoryStepForward()

Redoes the history to the next history mark.

vrImportAssetLibrary​

void vrImportAssetLibrary(
string file
)

Imports an asset library.

Parameters:

  • file Path to the asset library file

vrIsClustered​

void vrIsClustered()

Returns true if running in a cluster configuration.

vrIsDebugBuild​

void vrIsDebugBuild()

Returns true if the DEBUG compilation flag was defined.

vrIsStereoAvailable​

boolean vrIsStereoAvailable(
number mode =0
)

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

vrIsSystemNode​

boolean vrIsSystemNode(
vrnode node
)

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

vrIsToolEnabled​

boolean vrIsToolEnabled(
string toolName,
vrnode userNode =nil
)

Tests whether a named Tool is enabled.

Parameters:

  • toolName The name of the tool that is tested
  • userNode The user the tool belongs to. If none is specified, the current user is used

Return: true if it is enabled

vrIsTrackingEnabled​

boolean vrIsTrackingEnabled()

Gets the enabled state of the user's tracking.

Return: true if it is enabled

vrLaunchProcess​

boolean vrLaunchProcess(
string cmdline,
boolean pipeOutput =false,
number timeout =0.0
)

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.

Return: True if the process started successfully.

vrLinkNetwork​

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

vrListExports​

string vrListExports()

List all Lua VR extension functions.

Return: List of function names separated by new lines

vrLoadAvatarFromFile​

void vrLoadAvatarFromFile(
vrnode parent,
string filename
)

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

vrLoadAvatarFromFileToEdit​

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.

vrLoadPlugin​

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

vrLocalUserNode​

vrnode vrLocalUserNode()

Returns the local user's node.

vrMakeArrow​

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

Creates an arrow shape.

vrMakeBox​

vrnode vrMakeBox(
vrnode parent,
string name,
number width,
number height,
number depth,
number stacks,
number slices,
boolean reverseWinding
)

Creates a box shape.

vrMakeCylinder​

vrnode vrMakeCylinder(
vrnode parent,
string name,
number bottomRadius,
number topRadius,
number height,
number stacks,
number slices,
boolean reverseWinding
)

Creates a cylinder shape.

vrMakeEllipsoid​

vrnode vrMakeEllipsoid(
vrnode parent,
string name,
number radiusX,
number radiusY,
number radiusZ,
number stacks,
number slices,
boolean reverseWinding
)

Creates an ellipsoid shape.

vrMakePlane​

vrnode vrMakePlane(
vrnode parent,
string name,
number hsize,
number vsize
number stacks,
number slices,
boolean reverseWinding,
boolean doubleSided
)

Creates a plane shape.

vrMakeTorus​

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

Creates a torus shape.

vrModifierPressed​

boolean vrModifierPressed(
number id
)

Tests whether any modifier keys are pressed.

Parameters:

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

Return: true if the modifier key is currently being pressed

vrNetworkSetRetryConnect​

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

vrParseJSON​

table vrParseJSON(
string data
)

Parse JSON data into a Lua table.

Parameters:

  • data JSON data

Return: The parsed data in Lua tables matching the original JSON structure

vrParseXML​

table vrParseXML(
string xml
)

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

Parameters:

  • xml The XML to parse

Return: Table representing the document structure

vrPluginsDir​

string vrPluginsDir()

Gets the Visionary Render plugins directory.

Return: Absolute path to the plugins directory in the application install folder

vrPostCommand​

void vrPostCommand(
string cmd,
string param =0,
vrnode user =nil
)

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)

vrPrimaryUserNode​

void vrPrimaryUserNode()

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

vrPushRecentFile​

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.

vrPushRecentImportFile​

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.

vrReleaseManikin​

void vrReleaseManikin(
vrnode manikinOrUser
)

Releases a manikin from the user who is controlling it.

Parameters:

  • manikinOrUser The manikin to release or the user who is controlling the manikin

vrReleaseObjectFromTrackedHand​

void vrReleaseObjectFromTrackedHand(
vrnode target =nil,
number handIndex =-1,
vrnode user =nil
)

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)
  • handIndex -1 for any hand, 0, for left hand, 1 for right hand
  • user The user holding the node, or nil to deduce the user automatically

vrReloadAudio​

void vrReloadAudio(
vrnode node
)

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

vrReloadTextures​

void vrReloadTextures(
vrnode node
)

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.

vrRemoveRecentItem​

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'

vrRescalePRSManipulator​

void vrRescalePRSManipulator()

Refreshes the scale of the PRS manipulator.

vrScaleTexture​

void vrScaleTexture(
vrnode node,
number scaleX,
number scaleY =0.0
)

Scales a texture by the specified factor.

Parameters:

  • node vrnode The texture to scale
  • scaleX number The horizontal scale factor
  • scaleY number The vertical scale factor

vrSetConfigMode​

void vrSetConfigMode(
number mode =CM_MODE_COUNT
)

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

Parameters:

  • mode Immersive mode value

vrSetToolEnabled​

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

Sets the Enabled state of a named Tool.

Parameters:

  • toolName The name of the tool that its Enabled state is being changed
  • enabled The state that we are applying to the tool (true/false)
  • userNode The user the tool belongs to. If none is specified, the current user is used

vrSetTrackedEyeNode​

void vrSetTrackedEyeNode(
vrnode node =nil
)

Sets the tracked eye to the specified node.

vrSetTrackedHandNode​

void vrSetTrackedHandNode(
vrnode node =nil,
number index =1
)

Sets the tracked hand to the specified node.

Parameters:

  • index 0 for left hand, 1 for right hand

vrSetViewportLayout​

void vrSetViewportLayout(
vrnode viewportLayoutNode,
vrnode userNode =nil
)

Sets the user's current viewport layout.

Parameters:

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

vrShouldSaveCamera​

boolean vrShouldSaveCamera()

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

vrSnapshotApply​

void vrSnapshotApply(
vrnode snapNode
)

Applies the specified snapshot.

vrSplitFilePath​

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

Returns file directory, name, and extension.

Parameters:

  • path Relative or absolute path to test

Return:

  • File Directory
  • File Name
  • File Extension

vrSplitVirtalisHubURL​

void vrSplitVirtalisHubURL(
string url
)

Identifies a Virtalis Hub URL and splits out the server name, artifact ID and artifact name.

Parameters:

  • url The Virtalis Hub URL

vrSubDirs​

table vrSubDirs(
string path
)

Gets the subdirectories of a directory.

Parameters:

  • path Path to the directory to scan

Return: Array of subdirectory names

vrToggleProjection​

void vrToggleProjection()

Toggles the current viewport between perspective and orthographic views.

vrToggleToolEnabled​

void vrToggleToolEnabled(
string toolName,
vrnode userNode =nil
)

Toggles the Enabled state of a named Tool.

Parameters:

  • toolName The name of the tool that its Enabled state is being toggled
  • userNode The user the tool belongs to. If none is specified, the current user is used

vrTrackedCursorGetTouchedAssembly​

void vrTrackedCursorGetTouchedAssembly(
number index
)

Gets the first assembly currently under the tracked cursor.

Parameters:

  • index The index of the hand to check, 0 = left hand, 1 = right hand [default: 1]

vrUnloadPlugin​

void vrUnloadPlugin(
string pluginInfo
)

vrUserDocumentsDir​

string vrUserDocumentsDir()

Gets the current user's documents directory.

Return: Absolute path to the user's Visionary Render documents folder

vrUserPluginsDir​

string vrUserPluginsDir()

Gets the current applications users plug-ins directory.

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

vrUsingHMD​

boolean vrUsingHMD()

Returns whether or not we are using a HMD.