Skip to content
07-848 2005

V-Ray for Rhino

V-Ray Script Access

In V-Ray it is now possible to access the underlying scene plugins via the Rhino script tools.

Last updated 15 June 2026

In V-Ray it is now possible to access the underlying scene plugins via the Rhino script tools.

A script access manual is provided with the installation of V-Ray. It can be found at the V-Ray for Rhino root folder C:\Program Files\Chaos\V-Ray\V-Ray for Rhinoceros\VRayForRhinoObjectModel.html

Due to the way V-Ray for Rhino communicates with its UI, certain "user data" parameters are employed while the actual scene parameters are set accordingly only at render time.

The precise names of such "user data" parameters can be found listed in exported V-Ray files:

  • for Settings - export a .vropt file
  • for Assets - export an asset of the required type as a .vrmat file

Their parameter handlers contain isUserData="1".

To set a parameter value in the V-Ray UI via a script, the "user data" counterpart must be used. Otherwise, the change will only affect the V-Ray scene.

ParamTypes

Enumeration

Name

Value

Description

Name

Value

Description

T_UNKNOWN

0

Undefined type. Generally an error

T_INTEGER

1

Standard long integer number

T_FLOAT

2

Single precision floating-point number

T_STRING

4

Character string value

T_BOOL

8

Boolean value

T_TRANSFORM

16

Transformation value, consisting of a matrix and a vector. Equivalent to 12-element single-precision floating-point array

T_MATRIX

32

Matrix value. Equivalent to 9-element single-precision floating-point array

T_VECTOR

64

Vector value. Equivalent to 3-element single-precision floating-point array

T_COLOR

128

RGB float color value. Equivalent to 3-element single-precision floating-point array

T_ACOLOR

256

RGBA float color value. Equivalent to 4-element single-precision floating-point array

T_LIST

32768

Binary OR-ed with the other type indicates that the value is a list of values of that type

RenderModes

Enumeration

Property Name

Value

Description

Property Name

Value

Description

RM_PRODUCTION

0

Renders in production mode

RM_INTERACTIVE

1

Renders in interactive mode

RM_CLOUD

2

Starts the current render job on the Cloud

RM_LAST

3

Repeats the last render

RenderEngines

Enumeration

Property Name

Value

Description

Property Name

Value

Description

RE_CPU

0

Renders on the CPU

RE_CUDA

1

Renders on the GPU and/or CPU using CUDA

RE_RTX

2

Renders on the GPU using RTX Optix

RhinoScriptComputeDeviceInfo

A structure packing all details for a GPU compute device into a single block

Property Name

Description

Property Name

Description

Name

The name of the device

UseForRendering

Specifies whether the device is to be used for rendering or not

Name

Name of the device

Syntax:

BSTR Name

Examples:

IronPython 2.7

CPython 3.9

C# 9.0

UseForRendering

Specifies whether the device is to be used for rendering or not

Syntax:

VARIANT_BOOL UseForRendering

Examples:

IronPython 2.7

CPython 3.9

C# 9.0

RhinoScriptSceneParam

Represents a reference to a NeUI plugin parameter

Property Name

Description

Property Name

Description

Value

Gets or sets the value of the parameter. Must conform with the value type

Type

Returns the data type of the parameter. Can be OR-ed with ParamTypes::T_LIST

TypeAsString

Returns the data type of the parameter as a string

Value

Gets or sets the value of the parameter. Must conform with the value type

Syntax:

VARIANT Value

Examples:

IronPython 2.7

CPython 3.9

C# 9.0

Type

Returns the data type of the parameter. Can be OR-ed with ParamTypes::T_LIST

Syntax:

ParamTypes Type

Examples:

IronPython 2.7

CPython 3.9

C# 9.0

TypeAsString

Returns the data type of the parameter as string.

Syntax:

BSTR TypeAsString

Examples:

IronPython 2.7

CPython 3.9

C# 9.0

RhinoScriptScenePlugin

Represents a reference to a NeUI plugin

Property Name

Description

Property Name

Description

Params

Returns an array of references to all parameters for the current plugin

ParamNames

Returns an array of strings containing all parameter names in the current plugin

Name

Returns the name of the plugin

Category

Returns the category of the plugin

Type

Returns the type of the plugin

Method Name

Description

Method Name

Description

Param

Returns a reference to a given plugin parameter

Params

Returns an array of references to all parameters for the current plugin

Syntax:

VARIANT Params

Examples:

IronPython 2.7

CPython 3.9

C# 9.0

ParamNames

Returns an array of strings of all parameter names in the current plugin

Syntax:

VARIANR ParamNames

Examples:

IronPython 2.7

CPython 3.9

C# 9.0

Name

Gets or sets the name of the plugin

Syntax:

BSTR Name

Examples:

IronPython 2.7

CPython 3.9

C# 9.0

Category

Returns the category of the plugin

Syntax:

BSTR Category

Examples:

IronPython 2.7

CPython 3.9

C# 9.0

Type

Returns the type of the plugin

Syntax:

BSTR Type

Examples:

IronPython 2.7

CPython 3.9

C# 9.0

Param

Returns a reference to a given plugin parameter

Syntax:

RhinoScriptSceneParam *Param(
[in, string] BSTR paramName
)

Parameters:

[in] BSTR paramName : Name of the parameter to getReturn:

RhinoScriptSceneParam

Examples:

IronPython 2.7

CPython 3.9

C# 9.0

RhinoScriptScene

Represents the NeUI scene

Method Name

Description

Method Name

Description

Plugins

Returns an array of references to all plugins in the scene

PluginNames

Returns an array of strings of all plugin names in the scene

Method Name

Description

Method Name

Description

Plugin

Returns a reference to a given scene plugin

PluginFromObject

Returns a reference to a plugin that is linked to a Rhino model object, given by ID

PluginsByType

Returns an array of references to all plugins of a given type in the scene

PluginsByCategory

Returns an array of references to all plugins of a given category in the scene

Refresh

Refreshes the NeUI window

Materials

Gets an array of all material plugins in the scene

Lights

Gets an array of all light plugins in the scene

Settings

Gets an array of all settings plugins in the scene

SpecialObjects

Gets an array of all special object plugins (proxies, clippers, furs and infinite planes) in the scene

LoadSettings

Loads a given .vropt file into the scene. The default file will be loaded on failure

SaveSettings

Saves the current settings into a given .vropt file

BeginChange

Opens a transaction to modify the scene. Call EndChange() when done modifying the scene

EndChange

Closes a scene modification transaction, previously opened by a call to BeginChange()

Plugins

Returns an array of references to all plugins in the scene

Syntax:

VARIANT Plugins

Examples:

IronPython 2.7

CPython 3.9

C# 9.0

PluginNames

Returns an array of strings of all plugin names in the scene

Syntax:

VARIANT PluginNames

Examples:

IronPython 2.7

CPython 3.9

C# 9.0

Plugin

Returns a reference to a given scene plugin

Syntax:

RhinoScriptScenePlugin* Plugin(

[in, string] const BSTR pluginName
)

Parameters:

[in] BSTR pluginName : Name of the plugin to get

Return:

RhinoScriptScenePlugin

Examples:

IronPython 2.7

CPython 3.9

C# 9.0

PluginFromObject

Returns a reference to a plugin that is linked to an Rhino model object, given by ID

Syntax:

VARIANT PluginFromObject(

[in, string] const BSTR id
)

Parameters:

[in] BSTR id : Rhino model object id to query

Return:

RhinoScriptScenePlugin

Examples:

IronPython 2.7

CPython 3.9

C# 9.0

PluginsByType

Returns an array of references to all plugins of a given type in the scene

Syntax:

VARIANT PluginsByType(
[in, string] const BSTR typeName

[in] VARIANT_BOOL onlyTopLevel

)

Parameters:

[in] BSTR typeName : Name of the plugins Type

[in] VARIANT_BOOL onlyTopLevel : VARIANT_TRUE to consider only top-level plugins, or all plugins otherwise. VARIANT_TRUE by default

Return:

VARIANT array of RhinoScriptScenePlugin

Examples:

IronPython 2.7

CPython 3.9

C# 9.0

PluginsByCategory

Returns an array of references to all plugins of a given category in the scene

Syntax:

VARIANT PluginsByCategory(
[in, string] const BSTR categoryName
[in] VARIANT_BOOL onlyTopLevel
)

Parameters:

[in] BSTR categoryName : Name of the plugins type

[in] VARIANT_BOOL onlyTopLevel : VARIANT_TRUE to consider only top-level plugins, or all plugins otherwise. VARIANT_TRUE by default

Return:

VARIANT array of RhinoScriptScenePlugin

Examples:

IronPython 2.7

CPython 3.9

C# 9.0

Refresh

Refreshes the NeUI window

Syntax:

void Refresh()

Examples:

IronPython 2.7

CPython 3.9

C# 9.0

Materials

Gets an array of all material plugins in the scene

Syntax:

VARIANT Materials()

Return:

VARIANT array of RhinoScriptScenePlugin

Examples:

IronPython 2.7

CPython 3.9

C# 9.0

Lights

Gets an array of all light plugins in the scene

Syntax:

VARIANT Lights()

Return:

VARIANT array of RhinoScriptScenePlugin

Examples:

IronPython 2.7

CPython 3.9

C# 9.0

Settings

Gets an array of all settings plugins in the scene

Syntax:

VARIANT Settings()

Return:

VARIANT array of RhinoScriptScenePlugin

Examples:

IronPython 2.7

CPython 3.9

C# 9.0

SpecialObjects

Gets an array of all special object plugins (proxies, clippers, furs and infinite planes) in the scene

Syntax:

VARIANT SpecialObjects()

Return:

VARIANT array of RhinoScriptScenePlugin

Examples:

IronPython 2.7

CPython 3.9

C# 9.0

LoadSettings

Loads a given .vropt file into the scene. The default file will be loaded on failure

Syntax:

VARIANT_BOOL LoadSettings(
[in, string] const BSTR fileName
)

Parameters:

[in] BSTR fileName : Name of the file to load in

Return:

None-zero if succeeded, zero if failed

Examples:

IronPython 2.7

CPython 3.9

C# 9.0

SaveSettings

Saves the current settings into a given .vropt file

Syntax:

VARIANT_BOOL SaveSettings(
[in, string] const BSTR fileName
)

Parameters:

[in] BSTR fileName : Name of the file to write out

Return:

None-zero if succeeded, zero if failed

Examples:

IronPython 2.7

CPython 3.9

C# 9.0

BeginChange

Opens a transaction to modify the scene. Call EndChange() when done modifying the scene

Syntax:

void BeginChange()

Examples:

IronPython 2.7

CPython 3.9

C# 9.0

EndChange

Closes a scene modification transaction, previously opened by a call to BeginChange()

Syntax:

void EndChange()

Examples:

IronPython 2.7

CPython 3.9

C# 9.0

RhinoScriptObject

Represents the NeUI scene

Property Name

Description

Property Name

Description

Scene

Returns the currently active scene

Version

Returns the current plugin version

VRayVersion

Returns the current V-Ray core version

Method Name

Description

Method Name

Description

Render

Starts a V-Ray render

CancelRender

Stops the current rendering process

RefreshUI

Refreshes the NeUI asset manager window

GetDeviceList

Returns the compute devices available on the machine for a given render mode

SetDeviceList

Sets a list of devices available on the machine, to be used for a given render mode

Scene

Returns the currently active scene

Syntax:

RhinoScriptScene* Scene

Examples:

IronPython 2.7

CPython 3.9

C# 9.0

Version

Returns the current plugin version

Syntax:

int Version

Examples:

IronPython 2.7

CPython 3.9

C# 9.0

VRayVersion

Returns the current V-Ray core version

Syntax:

int VRayVersion

Examples:

IronPython 2.7

CPython 3.9

C# 9.0

Render

Starts a V-Ray render

Syntax:

void Render(
[in] RenderModes mode,
[in] RenderEngines engine,
[in] int timeout
)

Parameters:

[in] RenderModes mode: Specifies the mode the render job shall be executed in

[in] RenderEngines engine: Specifies the render engine to use for the current render job

[in] int timeout: Specifies whether the current render job shall be executed synchronously or asynchronously.
Use -1 for syncrhonous renders, and >=0 for specific wait timeout in milliseconds

Examples:

IronPython 2.7

CPython 3.9

C# 9.0

CancelRender

Stops the current rendering process

Syntax:

void CancelRender()

Examples:

IronPython 2.7

CPython 3.9

C# 9.0

RefreshUI

Refreshes the NeUI asset manager window

Syntax:

void RefreshUI()

Examples:

IronPython 2.7

CPython 3.9

C# 9.0

GetDeviceList

Returns the compute devices available on the machine for a given render mode

Syntax:

VARIANT GetDeviceList(RenderEngines engine)

Return:

VARIANT

Examples:

IronPython 2.7

CPython 3.9

C# 9.0

SetDeviceList

Sets a list of devices available on the machine, to be used for a given render mode

Syntax:

VARIANT_BOOL SetDeviceList(RenderEngines engine, VARIANT ids)

Return:

VARIANT_BOOL

Examples:

IronPython 2.7

CPython 3.9

C# 9.0

Render Quality

Changes the quality of the render from Low to High+.

Examples:

IronPython 2.7

CPython 3.9

C#

Value

Description

Value

Description

0

Low

1

Low +

2

Medium

3

Medium +

4

High

5

High +

6

Custom (uses the last used quality value)

Render Engine

Sets Render Engine modes.

Examples:

IronPython 2.7

CPython 3.9

C#

Value

Description

Value

Description

-1

RENDER_MODE_PRODUCTION

0

RENDER_MODE_INTERACTIVE

4

RENDER_MODE_INTERACTIVE_CUDA

7

RENDER_MODE_INTERACTIVE_OPTIX

104

RENDER_MODE_PRODUCTION_CUDA

107

RENDER_MODE_PRODUCTION_OPTIX

Notes

Note that for versions prior to V-Ray 7, the script access manual is located at: C:\Program Files\Chaos Group\V-Ray\V-Ray for Rhinoceros\VRayForRhinoObjectModel.html