Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.


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 Group\V-Ray\V-Ray for Rhinoceros\VRayForRhinoObjectModel.html

UI Text Box
typenote

To use the V-Ray for Rhino wrapper module, add a new Python Module Search path pointing to C:\Program Files\Chaos Group\V-Ray\V-Ray for Rhinoceros.

Alternatively, copy the rhVRay.py filefrom C:\Program Files\Chaos Group\V-Ray\V-Ray for Rhinoceros to %APPDATA%\McNeel\Rhinoceros\6.0\scripts and %APPDATA%\McNeel\Rhinoceros\6.0\scripts.


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

NameValueDescription
T_UNKNOWN0Undefined type. Generally an error
T_INTEGER1Standard long integer number
T_FLOAT2Single precision floating-point number
T_STRING4Character string value
T_BOOL8Boolean value
T_TRANSFORM16Transformation value, consisting of a matrix and a vector. Equivalent to 12-element single-precision floating-point array
T_MATRIX32Matrix value. Equivalent to 9-element single-precision floating-point array
T_VECTOR64Vector value. Equivalent to 3-element single-precision floating-point array
T_COLOR128RGB float color value. Equivalent to 3-element single-precision floating-point array
T_ACOLOR256RGBA float color value. Equivalent to 4-element single-precision floating-point array
T_LIST32768Binary OR-ed with the other type indicates that the value is a list of values of that type



RenderModes

Enumeration

Property NameValueDescription
RM_PRODUCTION0

Renders in production mode

RM_INTERACTIVE1

Renders in interactive mode

RM_CLOUD2

Starts the current render job on the Cloud

RM_LAST3Repeats the last render



RenderEngines

Enumeration

Property NameValueDescription
RE_CPU0

Renders on the CPU

RE_CUDA1

Renders on the GPU and/or CPU using CUDA

RE_RTX2

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

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:

Divbox
stylebackground-color:#e6f3ff; font-family: monospace
Tabs Container
directionhorizontal
Tabs Page
titleIronPython 2.7

import rhVRay as vray

cudaDevices = vray.GetDeviceList(vray.RenderEngines.RE_CUDA)
name = cudaDevices[0].Name

Tabs Page
titleCPython 3.9

import rh8VRay as vray

cudaDevices = vray.GetDeviceList(vray.RenderEngines.RE_CUDA)
name = cudaDevices[0].Name

Tabs Page
titleC# 9.0

using VRayForRhino;

ComputeDeviceInfo[] cudaDevices = VRay.GetDeviceList(RenderEngines.CUDA).ToArray();
string name = cudaDevices[0].Name;




UseForRendering

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


Syntax:

VARIANT_BOOL UseForRendering

Examples:

Divbox
stylebackground-color:#e6f3ff; font-family: monospace
Tabs Container
directionhorizontal
Tabs Page
titleIronPython 2.7

import rhVRay as vray

cudaDevices = vray.GetDeviceList(vray.RenderEngines.RE_CUDA)
use = cudaDevices[0].UseForRendering

Tabs Page
titleCPython 3.9

import rh8VRay as vray

cudaDevices = vray.GetDeviceList(vray.RenderEngines.RE_CUDA)
use = cudaDevices[0].UseForRendering

Tabs Page
titleC# 9.0

using VRayForRhino;

ComputeDeviceInfo[] cudaDevices = VRay.GetDeviceList(RenderEngines.CUDA).ToArray();
bool use = cudaDevices[0].UseForRendering;



RhinoScriptSceneParam


Represents a reference to a NeUI plugin parameter

Property NameDescription
ValueGets or sets the value of the parameter. Must conform with the value type
TypeReturns the data type of the parameter. Can be OR-ed with ParamTypes::T_LIST
TypeAsStringReturns 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:


Divbox
stylebackground-color:#e6f3ff; font-family: monospace
Tabs Container
directionhorizontal
Tabs Page
titleIronPython 2.7

import rhVRay as vray

with vray.Scene.Transaction() as t:
    vray.Scene.SettingsOutput.img_width *= 2

Tabs Page
titleCPython 3.9

import rh8VRay as vray

with vray.Scene.Transaction() as t:
    vray.Scene.SettingsOutput.img_width *= 2

Tabs Page
titleC# 9.0

using VRayForRhino;

using(Transaction t =  VRay.Scene.Transaction())
{
    Param img_width = VRay.Scene["SettingsOutput"].Param("img_width");
    img_width.Value = (int)img_width.Value * 2;
}



Type

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


Syntax:

ParamTypes Type

Examples:


Divbox
stylebackground-color:#e6f3ff; font-family: monospace
Tabs Container
directionhorizontal
Tabs Page
titleIronPython 2.7

import rhVRay as vray
                    
paramType = vray.Scene.SettingsOutput.Param("img_width").Type

Tabs Page
titleCPython 3.9

import rh8VRay as vray
                    
paramType = vray.Scene.SettingsOutput.Param("img_width").Type

Tabs Page
titleC# 9.0

using VRayForRhino;
                    
int paramType = VRay.Scene["SettingsOutput"].Param("img_width").Type




TypeAsString

Returns the data type of the parameter as string. 


Syntax:

BSTR TypeAsString

Examples:


Divbox
stylebackground-color:#e6f3ff; font-family: monospace
Tabs Container
directionhorizontal
Tabs Page
titleIronPython 2.7

import rhVRay as vray
                    
paramType = vray.Scene.SettingsOutput.Param("img_width").TypeAsString

Tabs Page
titleCPython 3.9

import rh8VRay as vray
                    
paramType = vray.Scene.SettingsOutput.Param("img_width").TypeAsString

Tabs Page
titleC# 9.0

using VRayForRhino;
                    
string paramType = VRay.Scene["SettingsOutput"].Param("img_width").TypeAsString



RhinoScriptScenePlugin


Represents a reference to a NeUI plugin

Property NameDescription
ParamsReturns an array of references to all parameters for the current plugin
ParamNamesReturns an array of strings of all parameter names in the current plugin
NameReturns the name of the plugin
CategoryReturns the category of the plugin
TypeReturns the type of the plugin



Method NameDescription
ParamReturns a reference to a given plugin parameter



Params

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


Syntax:

VARIANT Params

Examples:


Divbox
stylebackground-color:#e6f3ff; font-family: monospace
Tabs Container
directionhorizontal
Tabs Page
titleIronPython 2.7

import rhVRay as vray

params = vray.Scene.SettingsOutput.Params

Tabs Page
titleCPython 3.9

import rh8VRay as vray

params = vray.Scene.SettingsOutput.Params

Tabs Page
titleC# 9.0

using VRayForRhino;

Param[] prms = VRay.Scene["SettingsOutput"].Params.ToArray();



ParamNames

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


Syntax:

VARIANR ParamNames

Examples:


Divbox
stylebackground-color:#e6f3ff; font-family: monospace
Tabs Container
directionhorizontal
Tabs Page
titleIronPython 2.7

import rhVRay as vray

paramName = vray.Scene.SettingsOutput.ParamNames

Tabs Page
titleCPython 3.9

import rh8VRay as vray

paramName = vray.Scene.SettingsOutput.ParamNames

Tabs Page
titleC# 9.0

using VRayForRhino;

string[] paramNames = VRay.Scene["SettingsOutput"].ParamNames.ToArray();




Name

Returns the name of the plugin


Syntax:

BSTR Name

Examples:


Divbox
stylebackground-color:#e6f3ff; font-family: monospace
Tabs Container
directionhorizontal
Tabs Page
titleIronPython 2.7

import rhVRay as vray

pluginName = vray.Scene.SettingsOutput.Name

Tabs Page
titleCPython 3.9

import rh8VRay as vray

pluginName = vray.Scene.SettingsOutput.Name

Tabs Page
titleC# 9.0

using VRayForRhino;

string pluginName = VRay.Scene["SettingsOutput"].Name;



Category

Returns the category of the plugin


Syntax:

BSTR Category

Examples:


Divbox
stylebackground-color:#e6f3ff; font-family: monospace
Tabs Container
directionhorizontal
Tabs Page
titleIronPython 2.7

import rhVRay as vray

pluginCategory = vray.Scene.SettingsOutput.Category

Tabs Page
titleCPython 3.9

import rh8VRay as vray

pluginCategory = vray.Scene.SettingsOutput.Category

Tabs Page
titleC# 9.0

using VRayForRhino;

string pluginCategory = VRay.Scene["SettingsOutput"].Category;



Type

Returns the type of the plugin

Syntax:

BSTR Type

Examples:

Divbox
stylebackground-color:#e6f3ff; font-family: monospace
Tabs Container
directionhorizontal
Tabs Page
titleIronPython 2.7

import rhVRay as vray

pluginType = vray.Scene.SettingsOutput.Type

Tabs Page
titleCPython 3.9

import rh8VRay as vray

pluginType = vray.Scene.SettingsOutput.Type

Tabs Page
titleC# 9.0

using VRayForRhino;

string pluginType = VRay.Scene["SettingsOutput"].Type;




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 get

 

Return: 

RhinoScriptSceneParam

Examples:


Divbox
stylebackground-color:#e6f3ff; font-family: monospace
Tabs Container
directionhorizontal
Tabs Page
titleIronPython 2.7

import rhVRay as vray

imgWidth = vray.Scene.SettingsOutput.Param("img_width")

Tabs Page
titleCPython 3.9

import rh8VRay as vray

imgWidth = vray.Scene.SettingsOutput.Param("img_width")

Tabs Page
titleC# 9.0

using VRayForRhino;

Param imgWidth = VRay.Scene["SettingsOutput"].Param("img_width");



RhinoScriptScene

Represents the NeUI scene


Method NameDescription
PluginsReturns an array of references to all plugins in the scene
PluginNamesReturns an array of strings of all plugin names in the scene


Method NameDescription
PluginReturns a reference to a given scene plugin
PluginFromObjectReturns a reference to a plugin that is linked to an Rhino model object, given by ID
PluginsByTypeReturns an array of references to all plugins of a given type in the scene
PluginsByCategoryReturns an array of references to all plugins of a given category in the scene
RefreshRefreshes the NeUI window
MaterialsGets an array of all material plugins in the scene
LightsGets an array of all light plugins in the scene
SettingsGets an array of all settings plugins in the scene
SpecialObjectsGets an array of all special object plugins (proxies, clippers, furs and infinite planes) in the scene
LoadSettingsLoads a given .vropt file into the scene. The default file will be loaded on failure
SaveSettingsSaves the current settings into a given .vropt file
BeginChangeOpens a transaction to modify the scene. Call EndChange() when done modifying the scene
EndChangeCloses 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:


Divbox
stylebackground-color:#e6f3ff; font-family: monospace
Tabs Container
directionhorizontal
Tabs Page
titleIronPython 2.7

import rhVRay as vray

plugins = vray.Scene.Plugins

Tabs Page
titleCPython 3.9

import rh8VRay as vray

plugins = vray.Scene.Plugins

Tabs Page
titleC# 9.0

using VRayForRhino;

Plugin[] plugins = VRay.Scene.Plugins.ToArray();



PluginNames

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


Syntax:

VARIANT PluginNames

Examples:


Divbox
stylebackground-color:#e6f3ff; font-family: monospace
Tabs Container
directionhorizontal
Tabs Page
titleIronPython 2.7

import rhVRay as vray

plugins = vray.Scene.PluginNames

Tabs Page
titleCPython 3.9

import rh8VRay as vray

plugins = vray.Scene.PluginNames

Tabs Page
titleC# 9.0

using VRayForRhino;

string[] pluginNames = VRay.Scene.PluginNames.ToArray();



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:


Divbox
stylebackground-color:#e6f3ff; font-family: monospace
Tabs Container
directionhorizontal
Tabs Page
titleIronPython 2.7

import  rhVRay as vray

settingsOutput = vray.Scene.Plugin("/SettingsOutput"

Tabs Page
titleCPython 3.9

import  rh8VRay as vray

settingsOutput = vray.Scene.Plugin("/SettingsOutput")

Tabs Page
titleC# 9.0

using VRayForRhino;

Plugin settingsOutput = vray.Scene.Plugin("/SettingsOutput");



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


Divbox
stylebackground-color:#e6f3ff; font-family: monospace
Tabs Container
directionhorizontal
Tabs Page
titleIronPython 2.7

import rhVRay as vray

vrayPlugin = vray.Scene.PluginFromObject("99dec31e-c736-4f7d-a98c-9dd321396344")

Tabs Page
titleCPython 3.9

import rh8VRay as vray

vrayPlugin = vray.Scene.PluginFromObject("99dec31e-c736-4f7d-a98c-9dd321396344")

Tabs Page
titleC# 9.0

using VRayForRhino;

Plugin vrayPlugin = VRay.Scene.PluginFromObject("99dec31e-c736-4f7d-a98c-9dd321396344");



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:


Divbox
stylebackground-color:#e6f3ff; font-family: monospace
Tabs Container
directionhorizontal
Tabs Page
titleIronPython 2.7

import rhVRay as vray

vrayMtlAssets = vray.Scene.PluginsByType("MtlSingleBRDF", True)
vrayMtlAll = vray.Scene.PluginsByType("MtlSingleBRDF", False)

Tabs Page
titleCPython 3.9

import rh8VRay as vray

vrayMtlAssets = vray.Scene.PluginsByType("MtlSingleBRDF", True)
vrayMtlAll = vray.Scene.PluginsByType("MtlSingleBRDF", False)

Tabs Page
titleC# 9.0

using VRayForRhino;

Plugin[] vrayMtlAssets = VRay.Scene.PluginsByType("MtlSingleBRDF", true).ToArray();
Plugin[] vrayMtlAll = VRay.Scene.PluginsByType("MtlSingleBRDF", false).ToArray();



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:


Divbox
stylebackground-color:#e6f3ff; font-family: monospace
Tabs Container
directionhorizontal
Tabs Page
titleIronPython 2.7

import rhVRay as vray

mtls = vray.Scene.PluginsByCategory("material", True)
all_mtl_plugins = vray.Scene.PluginsByCategory("material", False)

Tabs Page
titleCPython 3.9

import rh8VRay as vray

mtls = vray.Scene.PluginsByCategory("material", True)
all_mtl_plugins = vray.Scene.PluginsByCategory("material", False)

Tabs Page
titleC# 9.0

using VRayForRhino;

Plugin[] mtls = VRay.Scene.PluginsByCategory("material", true).ToArray();
Plugin[] all_mtl_plugins = VRay.Scene.PluginsByCategory("material", false).ToArray();



Refresh

Refreshes the NeUI window


Syntax:

void Refresh()
Examples:


Divbox
stylebackground-color:#e6f3ff; font-family: monospace
Tabs Container
directionhorizontal
Tabs Page
titleIronPython 2.7

import rhVRay as vray

vray.Scene.Refresh

Tabs Page
titleCPython 3.9

import rh8VRay as vray

vray.Scene.Refresh

Tabs Page
titleC# 9.0

using VRayForRhino;

VRay.Scene.Refresh();



Materials

Gets an array of all material plugins in the scene


Syntax:

VARIANT Materials()


Return:

VARIANT array of RhinoScriptScenePlugin
Examples:


Divbox
stylebackground-color:#e6f3ff; font-family: monospace
Tabs Container
directionhorizontal
Tabs Page
titleIronPython 2.7

import rhVRay as vray

materials = vray.Scene.Materials

Tabs Page
titleCPython 3.9

import rh8VRay as vray

materials = vray.Scene.Materials

Tabs Page
titleC# 9.0

using VRayForRhino;

Plugin[] materials = VRay.Scene.Materials.ToArray();



Lights

Gets an array of all light plugins in the scene


Syntax:

VARIANT Lights()


Return:

VARIANT array of RhinoScriptScenePlugin
Examples:


Divbox
stylebackground-color:#e6f3ff; font-family: monospace
Tabs Container
directionhorizontal
Tabs Page
titleIronPython 2.7

import rhVRay as vray

lights = vray.Scene.Lights

Tabs Page
titleCPython 3.9

import rh8VRay as vray

lights = vray.Scene.Lights

Tabs Page
titleC# 9.0

using VRayForRhino;

Plugin[] lights = VRay.Scene.Lights.ToArray();


 


Settings

Gets an array of all settings plugins in the scene


Syntax:

VARIANT Settings()


Return:

VARIANT array of RhinoScriptScenePlugin
Examples:


Divbox
stylebackground-color:#e6f3ff; font-family: monospace
Tabs Container
directionhorizontal
Tabs Page
titleIronPython 2.7

import rhVRay as vray

settings = vray.Scene.Settings

Tabs Page
titleCPython 3.9

import rh8VRay as vray

settings = vray.Scene.Settings

Tabs Page
titleC# 9.0

using VRayForRhino;

Plugin[] settings = VRay.Scene.Settings.ToArray();

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:


Divbox
stylebackground-color:#e6f3ff; font-family: monospace
Tabs Container
directionhorizontal
Tabs Page
titleIronPython 2.7

import rhVRay as vray

specialObj = vray.Scene.SpecialObjects

Tabs Page
titleCPython 3.9

import rh8VRay as vray

specialObj = vray.Scene.SpecialObjects

Tabs Page
titleC# 9.0

using VRayForRhino;

Plugin[] specialObj = VRay.Scene.SpecialObjects.ToArray();



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:


Divbox
stylebackground-color:#e6f3ff; font-family: monospace
Tabs Container
directionhorizontal
Tabs Page
titleIronPython 2.7

import rhVRay as vray

success = vray.Scene.LoadSettings("Rhino Default.vropt")

Tabs Page
titleCPython 3.9

import rh8VRay as vray

success = vray.Scene.LoadSettings("Rhino Default.vropt")

Tabs Page
titleC# 9.0

using VRayForRhino;

bool success = VRay.Scene.LoadSettings("Rhino Default.vropt");



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:


Divbox
stylebackground-color:#e6f3ff; font-family: monospace
Tabs Container
directionhorizontal
Tabs Page
titleIronPython 2.7

import rhVRay as vray

success = vray.Scene.SaveSettings("settings.vropt")

Tabs Page
titleCPython 3.9

import rh8VRay as vray

success = vray.Scene.SaveSettings("settings.vropt")

Tabs Page
titleC# 9.0

using VRayForRhino;

bool success = VRay.Scene.SaveSettings("settings.vropt");



BeginChange

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


Syntax:

void BeginChange()

Examples:


Divbox
stylebackground-color:#e6f3ff; font-family: monospace
Tabs Container
directionhorizontal
Tabs Page
titleIronPython 2.7

import rhVRay as vray

vray.Scene.BeginChange()
# scene modification statements
vray.Scene.EndChange()

# or in a RAII-manner
with vray.Scene.Transaction():
    # scene modification statements.
    # exiting the scope is equivalent to calling vray.Scene.EndChange()

Tabs Page
titleCPython 3.9

import rh8VRay as vray

vray.Scene.BeginChange()
# scene modification statements
vray.Scene.EndChange()

# or in a RAII-manner
with vray.Scene.Transaction():
    # scene modification statements.
    # exiting the scope is equivalent to calling vray.Scene.EndChange()

Tabs Page
titleC# 9.0

using VRayForRhino;

VRay.Scene.BeginChange();
// scene modification statements
VRay.Scene.EndChange();

// or in a RAII-manner
using(Transaction tr = VRay.Scene.Transaction())
{
    // scene modification statements.
    // exiting the scope is equivalent to calling VRay.Scene.EndChange()



EndChange

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


Syntax:

void EndChange()

Examples:

Divbox
stylebackground-color:#e6f3ff; font-family: monospace
Tabs Container
directionhorizontal
Tabs Page
titleIronPython 2.7

import rhVRay as vray

vray.Scene.BeginChange()
    # scene modification statements
vray.Scene.EndChange()

#or in a RAII-manner
with vray.Scene.Transaction():
    # scene modification statements.
    # exiting the scope is equivalent to calling vray.Scene.EndChange()

Tabs Page
titleCPython 3.9

import rh8VRay as vray

vray.Scene.BeginChange()
    # scene modification statements
vray.Scene.EndChange()

#or in a RAII-manner
with vray.Scene.Transaction():
    # scene modification statements.
    # exiting the scope is equivalent to calling vray.Scene.EndChange()

Tabs Page
titleC# 9.0

using VRayForRhino;

VRay.Scene.BeginChange();
// scene modification statements
VRay.Scene.EndChange();

// or in a RAII-manner
using(Transaction tr = VRay.Scene.Transaction())
{
    // scene modification statements.
    // exiting the scope is equivalent to calling VRay.Scene.EndChange()




RhinoScriptObject

Represents the NeUI scene


Property NameDescription
SceneReturns the currently active scene
VersionReturns the current plugin version
VRayVersionReturns the current V-Ray core version
Method NameDescription
Render

Starts a V-Ray render

CancelRenderStops the current rendering process
RefreshUI

Refreshes the NeUI asset manager window

GetDeviceListReturns the compute devices available on the machine for a given render mode
SetDeviceListSets 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:

Divbox
stylebackground-color:#e6f3ff; font-family: monospace
Tabs Container
directionhorizontal
Tabs Page
titleIronPython 2.7

import rhVRay as vray

scene = vray.Scene

Tabs Page
titleCPython 3.9

import rh8VRay as vray

scene = vray.Scene

Tabs Page
titleC# 9.0

using VRayForRhino;

Scene scene = VRay.Scene;



Version

Returns the current plugin version


Syntax:

int Version


Examples:


Divbox
stylebackground-color:#e6f3ff; font-family: monospace
Tabs Container
directionhorizontal
Tabs Page
titleIronPython 2.7

import rhVRay as vray

version = vray.Version

Tabs Page
titleCPython 3.9

import rh8VRay as vray

version = vray.Version

Tabs Page
titleC# 9.0

using VRayForRhino;

int version = VRay.Version;



VRayVersion

Returns the current V-Ray core version


Syntax:

int VRayVersion


Examples:


Divbox
stylebackground-color:#e6f3ff; font-family: monospace
Tabs Container
directionhorizontal
Tabs Page
titleIronPython 2.7

import rhVRay as vray

vray_version = vray.VRayVersion

Tabs Page
titleCPython 3.9

import rh8VRay as vray

vray_version = vray.VRayVersion

Tabs Page
titleC# 9.0

using VRayForRhino;

int vray_version = VRay.VRayVersion;



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:


Divbox
stylebackground-color:#e6f3ff; font-family: monospace
Tabs Container
directionhorizontal
Tabs Page
titleIronPython 2.7

import rhVRay as vray

vray.Render(0, 0, -1)

Tabs Page
titleCPython 3.9

import rh8VRay as vray

vray.Render(0, 0, -1)

Tabs Page
titleC# 9.0

using VRayForRhino;

VRay.Render(0, 0, -1);



CancelRender

Stops the current rendering process


Syntax:

void CancelRender()
Examples:


Divbox
stylebackground-color:#e6f3ff; font-family: monospace
Tabs Container
directionhorizontal
Tabs Page
titleIronPython 2.7

import rhVRay as vray

vray.CancelRender()

Tabs Page
titleCPython 3.9

import rh8VRay as vray

vray.CancelRender()

Tabs Page
titleC# 9.0

using VRayForRhino;

VRay.CancelRender();



RefreshUI

Refreshes the NeUI asset manager window


Syntax:

void RefreshUI()
Examples:


Divbox
stylebackground-color:#e6f3ff; font-family: monospace
Tabs Container
directionhorizontal
Tabs Page
titleIronPython 2.7

import rhVRay as vray

vray.RefreshUI()

Tabs Page
titleCPython 3.9

import rh8VRay as vray

vray.RefreshUI()

Tabs Page
titleC# 9.0

using VRayForRhino;

VRay.RefreshUI();



GetDeviceList


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

Syntax:

VARIANT GetDeviceList(RenderEngines engine)

Return:

VARIANT

Examples:


Divbox
stylebackground-color:#e6f3ff; font-family: monospace
Tabs Container
directionhorizontal
Tabs Page
titleIronPython 2.7

import rhVRay as vray

cudaDevices = vray.GetDeviceList(vray.RenderEngines.RE_CUDA)

Tabs Page
titleCPython 3.9

import rh8VRay as vray

cudaDevices = vray.GetDeviceList(vray.RenderEngines.RE_CUDA)

Tabs Page
titleC# 9.0

using VRayForRhino;

ComputeDeviceInfo[] cudaDevices = VRay.GetDeviceList(RenderEngines.CUDA).ToArray();



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:


Divbox
stylebackground-color:#e6f3ff; font-family: monospace
Tabs Container
directionhorizontal
Tabs Page
titleIronPython 2.7

import rhVRay as vray

success = vray.SetDeviceList(vray.RenderEngines.RE_CUDA, [0, 1])

Tabs Page
titleCPython 3.9

import rh8VRay as vray

success = vray.SetDeviceList(vray.RenderEngines.RE_CUDA, [0, 1])

Tabs Page
titleC# 9.0

using VRayForRhino;

bool success = VRay.SetDeviceList(RenderEngines.CUDA, new int[]{ 0, 1 });