An extension of vray.Color that adds an alpha channel as the 4th component.
"alpha" means opacity, the opposite of transparency.
Available constructors are:
AColor()
AColor(number, number, number, number)
AColor(number[])
AColor(Color|AColor)
AColor(Color, number)
(number)
: AColor red component
(number)
: AColor green component
(number)
: AColor blue component
(number)
: AColor alpha component
Creates a copy of this AColor with RGB components converted from sRGB to linear
Acolor
:
Returns the new AColor.
Creates a copy of this AColor with RGB components converted from linear to sRGB
Acolor
:
Returns the new AColor.
Instances of this class are used to binary serialize user attributes to V-Ray IntList.
Used in Proxy.createMeshFile() and Proxy.createCombinedMeshFile()
Type: object
Add user attribute.
(string)
name of the user attribute to add.
bool
:
true on success.
Finalize attributes per instance. Call close() to separate attributes between different instances.
Get binary serialized data as IntList for easier assignment as plugin property value. This will reset the state of BinUserAttributesWriter and clear all the data held in it!
IntList
:
The binary serialized data as IntList.
Returns a list of all Plugin instances of the passed category lists. The plugins returned are either of all categories of the first array or of all categories of the second arrays, etc. (It's an AND operation of the categories of each array and OR operation between the arrays.)
PluginList
:
An array-like list of all Plugin instances of this category.
A type class that defines a particular V-Ray render plugin category. It holds all the classes which belong to this category
Type: Object
Returns a list of all Plugin instances of this category.
PluginList
:
An array-like list of all Plugin instances of this category.
Returns the VRayRenderer instance to which this category belongs.
VRayRenderer
:
the VRayRenderer instance to which this class belongs.
A type class that defines a particular V-Ray render plugin type. It allows creation of new instances if called as a function. It also supplies meta information about the type.
Type: Object
Returns the VRayRenderer instance to which this class belongs.
VRayRenderer
:
the VRayRenderer instance to which this class belongs.
Obtains UI Guides information about all properties (if no arguments) or about a particular one (if a name is given as an argument). The information consists of the following fields (in general the object consists of a subset of the fields):
(string?)
Property name
(Object<string, Object> | Object)
:
Returns array with properties UI guides info.
Obtains meta information about all properties (if no arguments) or about a particular one (if a name is given as an argument). The meta information consists of the following fields:
(string?)
name of a property
(Object<string, Object> | Object)
:
Returns the meta information about the property if specified or all properties otherwise.
Returns a list of all Plugin instances of the class.
PluginList
:
An array-like list of all Plugin instances of the class.
Returns the last Plugin instance of the class or creates a new instance if not available. This is intended mostly for Settings plugin classes which should have only one instance in a scene.
(string?)
name of the plugin. If empty, a default name is used.
Plugin
:
The last Plugin instance of the class or creates a new instance if not available.
A 3-component floating point immutable color value.
It supports mathematical operations, indexing and equality checking.
In most contexts the component values are in the range [0, 1], but
in lighting calculations HDR values above 1.0 are possible.
Available constructors are:
Color()
Color(number, number, number)
Color(number[])
Color(Color|AColor)
(number)
: Color red component
(number)
: Color green component
(number)
: Color blue component
Creates a color with components equal to the normalized RGB color of a black body with the given temperature in Kelvin.
(double)
The color temperature in Kelvin.
(int)
The color space to use from
[
vray.Color.COLOR_SPACE_CIE, vray.Color.COLOR_SPACE_SRGB
]
. Default is Color.COLOR_SPACE_SRGB;
Color
:
Returns the Color created.
Compute the rgb to rgb transformation matrix between two linear color spaces This is an expensive operation and you should cache the matrix if possible
(int)
Source RGB color space
(int)
Destination RGB color space
Matrix
:
that converts from source to destination
(De)saturates the given color. Note that this will clamp (restrict a number between two other numbers) the color from below (e.g. no component will be below zero).
(number)
for k=0.0 means color is greyed; for k=1.0 means the color is unchanged; for k>1.0 adds more color
Color
:
(de)saturated color
Applies a contrast correction to the color and returns the new color
(number)
the contrast scale - 1.0 leaves the color unchanged and 0.0 makes the color equal to the middle
(number)
an optional argument: the contrast base - the level that remains unchanged (default value set to 0.5)
Color
:
contrast corrected color
A group of utility methods related to variuos geometry source plugins.
Type: Object
Returns the generated scatter transforms and source topology data, corresponding to the plugin parameter config.
(Plugin)
A GeomScatter plugin instance (the scatter data generation is triggered depending on the plugin parameter config).
TransformsAndTopo
:
Transforms and source topology lists or undefined on failure
Reads the data contained in the property GeomGaussians.file of the given plugin or in the given file
GaussianReadData
:
An object which contains all data necessary to create a preview of a single Gaussian model
typedef {object} TransformsAndTopo
(TransformList)
: Full output transforms data
((IntList | Int32Array))
: Full output source topology data. The indices are corresponding to the sources list in GeomScatter::models
Axis-aligned bounding box
typedef {object} Box
All related data necessary to create a preview of a single Gaussian model. Used by GeomUtils.readGaussianDataSync()
typedef {object} GaussianReadData
(Box)
: The preview bounding box of the model, calculated using the Gaussian primitive positions only
((VectorList | Float32Array))
: Full array of positions of the Gaussian primitives
((ColorList | Float32Array))
: Full array of average colors of the Gaussian primitives
Used in Proxy.createCombinedMeshFile()
Type: object
(Array<Transform>)
: A list of Transform objects for transforming the vertices and normals in 3D space. Must match the geomPlugins list.
(Array<AnimatedTransform>)
: Array of objects containing transformations at corresponding keyframes, to be written to the created file. The size must equal the mesh array size.
(Array<string>)
: Array of names to associate with respective meshes. This can be used to identify the pieces when reading the proxy.
(Array<number>)
: Array of unique IDs for the respective meshes. This should usually match Node.objectID values.
(number)
: Target number of triangles in each voxel.
(number)
: Number of preview triangles to generate. Set to 0 to disable preview. (default 10000)
(string)
: One of 'face_sampling', 'clustering', 'edge_collapse' or 'combined' (default).
(boolean)
: True if the mesh is animated.
(number)
: Where to start exporting the animation from.
(number)
: Where to stop exporting the animation.
(string)
: A file name to read and use its vertices and faces for the preview voxel
(boolean)
: Merge all voxels of the same type, before subdivision.
(ColorList)
: Array of diffuse (wire) colors - 1 Color per mesh object
(IntList)
: Array of smoothed flags (1 flag per mesh object - true if the voxel should be rendered with smoothed normals)
(IntList)
: Array of flipNormals flags (1 flag per mesh object - true if the geometric normals should be flipped)
(boolean)
: When enabled, adds a point cloud representation of the mesh separated into different levels of detail. The various levels of detail can be used by proxies for saving memory when rendering distant objects.
(number)
: Determines the size of point cloud disks at the most detailed level. If this value is small, point clouds rendered at the lowest level appear closer to original mesh but use more memory.
(number)
: Number of preview hairs (default 1000)
(number)
: Number of preview particles (default 20000)
(boolean)
: When enabled (default), applies the input Transform(s) to the geometry data, otherwise writes the Transform(s) into separate data channel.
Type: object
(boolean)
: True if device is set to be used for rendering
(boolean)
: True if device is set to be used for denoising
(boolean)
: True if device is supported
(string)
: Non-unique displayable name. Device index is its unique identifier.
(string)
: CPU, GPU or other
(number)
: In megabytes
(number)
: Number of displays (monitors) attached to this device. -1 if this information is unavailable
(number)
: Base clock frequency or -1 if not available
(number)
: Theoretical GFLOPS. 0 or -1 if not available
(number)
: CUDA Compute Capability Major version number
(number)
: CUDA Compute Capability Minor version number
Type: object
The necessary parameters passed to the VRayRenderer.enableDRClient() interface.
Type: object
(string)
: can either be an empty string or host
[
:port
]
(string)
: server:port connection parameter for http connections via proxy
(boolean)
: True if, when local dispatcher selected, it's configured to spawn a local render server
(boolean)
: True if a broadcast listener socket was created
(boolean)
: Whether to use pipelining. Note pipelining will be disabled internally (even if requested), if a proxy is configured or is discovered between the client and a remote server.
(boolean)
: TransferrableDrOptions
(boolean)
: TransferrableDrOptions
(number)
: Initial connection timeout in seconds
(number)
: Number of upstream connections, which the client side will use, when pipelining is not enabled
(number)
: Numeric progress verbosity level from 0 (none) to 4 (all, incl. debug)
Type: object
(boolean)
: if True only the current keyframe is exported, otherwise the whole timeline (default False)
(boolean)
: valid only when currentFrameOnly=true - whether to save separate frame files (default False)
(boolean)
: valid only when currentFrameOnly=True and appendFrameSuffix=False - set to True to incrementally append keyframe data after initial export with False (default False)
(number)
: valid only when currentFrameOnly=true. The (closed) time interval left of the current time in which to include keyframes, i.e. [left, right). Value 0.0 means automatic 1 frame based on FPS. (default 0.0)
(number)
: valid only when currentFrameOnly=true. The (open) time interval right of the current time in which to include keyframes, i.e. [left, right). Value 0.0 means automatic 1 frame based on FPS. (default 0.0)
(boolean)
: whether to compress lists of numbers when hexArrays==True (default True)
(boolean)
: whether to use hex format for lists of numbers (default True)
(boolean)
: whether to use hex format for Transform (default False)
(boolean)
: whether to save render elements to separate folders (default False)
(string)
: a string identifying the host application, version, etc.
(boolean)
: whether to write the comment section with version and time info (default True)
(Array<SubFileInfo>)
: used to split the scene into separate files based on plugin categories
(Array<Plugin>)
: if set, only these will be exported, otherwise all plugins are exported
(Array<string>)
: paths to write in #include directives at the end of the main vrscene
(boolean)
: If enabled, the paths for bitmap textures and other external files are stripped from the file so that only the filenames remain (default False)
(boolean)
: Enable or disable vrdata file writing
(number)
: Set a limit for the min size of the buffer. If the buffer is smaller it is not writen to the vrdata file
(number)
: Limit the size of the vrdata file. If this limit is reached. Another file is started
(boolean)
: Enable or disable vrfiles file writing
(string)
: Optional absolute scene base path that can be used for resolving relative paths for the .vrfiles file
(boolean)
: True if MD5 and SHA256 hashes should be computed and written in the .vrfiles file for each resolved asset file
Type: object
Type: object
(number)
: Number of camera rays traced per second
(number)
: Time since start
(number)
: Number of samples per pixel accumulated
(number)
: Number of sampling passes done
(number)
: Current noise threshold. Useful when dynamic noise threshold is enabled.
(number)
: Current rendering progress from 0.0 to 1.0
(Array<ComputeDeviceStatistics>)
: array of statistics for each device with valid data
A group of utility methods related to variuos light source plugins.
Type: Object
Returns the generated data needed for Luminaire field preview. If the second argument regarding the presence of the convex hull data is not provided then it will be resolved internally whether to provide the convex hull data.
(boolean)
Force the returned object to contain the convex hull data. Optional. If ommited, it will be resolved internally whether to provide the convex hull data.
BBoxAndVerticesAndFaceIndices
:
The preview data or undefined on failure
A 3x3 column-major matrix. Each column is a vray.Vector that can be indexed.
The usual mathematical operations are supported as well as equality checks.
This object is immutable.
Available constructors are:
Matrix()
Matrix(number, number, number, number, number, number, number, number, number)
Matrix(number[]|Vector, number[]|Vector, number[]|Vector)
Matrix(number)
Matrix(Matrix)
(Vector)
: Column0 of the matrix
(Vector)
: Column1 of the matrix
(Vector)
: Column2 of the matrix
A container for the data necessary to a export vrmesh with geometry, hair or particles. Used by Proxy.createMeshFile() and Proxy.createCombinedMeshFile()
Type: object
(object)
: ( VectorList ) (single frame) OR ( object[](number, VectorList) ) (multiple frames - where number is the corresponding keyFrame)
(object)
: ( IntList ) (single frame) OR ( object[](number, IntList) ) (multiple frames - where number is the corresponding keyFrame)
(object)
: ( VectorList ) (single frame) OR ( object[](number, VectorList) ) (multiple frames - where number is the corresponding keyFrame)
(object)
: ( IntList ) (single frame) OR ( object[](number, IntList) ) (multiple frames - where number is the corresponding keyFrame)
(object)
: ( VectorList ) (single frame) OR ( object[](number, VectorList) ) (multiple frames - where number is the corresponding keyFrame)
(object)
: ( IntList ) (single frame) OR ( object[](number, IntList) ) (multiple frames - where number is the corresponding keyFrame)
(object)
: ( StringList )
(object)
: ( IntList ) (single frame) OR ( object[](number, IntList) ) (multiple frames - where number is the corresponding keyFrame)
(object)
: ( VectorList ) (single frame) OR ( object[](number, VectorList) ) (multiple frames - where number is the corresponding keyFrame)
(object)
: ( IntList ) (single frame) OR ( object[](number, IntList) ) (multiple frames - where number is the corresponding keyFrame)
(object)
: ( FloatList ) (single frame) OR ( object[](number, FloatList) ) (multiple frames - where number is the corresponding keyFrame)
(object)
: ( VectorList ) (single frame) OR ( object[](number, VectorList) ) (multiple frames - where number is the corresponding keyFrame)
(object)
: ( FloatList ) (single frame) OR ( object[](number, FloatList) ) (multiple frames - where number is the corresponding keyFrame)
Initializes the OCIOConfigurationData instance with the provided configuration file or environment variable.
(string)
The file name from which the OCIO configuration will be read.
(int)
An integer matching the exact V-Ray source type as defined in TexOCIO::config_src. There are four modes :
[
Automatic, Environment, File, Internal
]
.
Automatic - Automatic mode - environment > stored environment > file > internal. (default value)
Environmet - Only environment is considered.
File - Only the file is considered.
Internal - Only the internal color spaces are considered.
Available constructors are:
OCIOConfigurationData()
OCIOConfigurationData(fileName)
OCIOConfigurationData(fileName, vraySourceType)
(Array<string>)
: List of stored color space families for the configuration. May be empty
(Array<string>)
: List of corresponding color spaces for each role. Size will match the roles size
(string)
: The symbol used as a separator to distinguish different families for UI separation
Type: object
A wrapper for a Plugin instance in the V-Ray core. It exposes the instance's properties as a dictionary. Deleting (unbinding) this object does not alter the V-Ray scene. You have to 'delete' the plugin from VRayRenderer.plugins in order to remove it from the scene.
Type: Object
Type: object
An Array-like object that holds plugin instances.
It consumes much less memory than a js array containg the same plugins.
Available constructors are:
PluginList()
PluginList(number)
PluginList(plugin1, plugin2, ...)
(integer)
: The number of plugin elements currently contained in the list
An extension over Plugin which adds an optional output property name.
Type: Object
Returns the VRayRenderer instance to which this plugin belongs.Returns the VRayRenderer instance to which this plugin belongs.
VRayRenderer
:
Returns the VRayRenderer instance to which this plugin belongs.
Returns a reference to this plugin and its specified property. The reference can act as a regular Plugin instance but when set as a value to another property, the Plugin::property will be set instead of just Plugin.
(string)
The name of the property.
PluginRef
:
Plugin::property.
Returns an array of keyframe times if the property is animated.
(string)
The name of the property.
Float64Array
:
Obtains runtime UI Guides information about all properties (if no arguments) or about a particular one (if a name is given as an argument). 'Runtime' in this case means that the 'hide' and 'enable' conditions will be evaluated on the time of the calling. The information consists of the following fields (in general the object consists of a subset of the fields):
(string?)
Property name
(Object<string, Object> | Object)
:
Returns array with properties UI guides info.
Obtains a runtime meta information dictionary about all properties (if no arguments) or about a particular one (if a name is given as an argument). 'Runtime' in this case means that the type of a property value might differ from that in the plugin class meta info. The meta information consists of the following fields:
(string?)
Property name
(Object<string, Object> | Object)
:
Returns array with properties meta info.
A namespace-like class for Profiler related methods. It's associated with one specific VRayRenderer instance and does not affect any other instances.
Type: Object
(boolean)
: Whether the profiler was started manually.
Initialize and start the profiler manually use in place of setVRayProfiler, if you want to use custom event tracking. Note that if you initialize the profiler through this method, you must also call profilerWriteAndFreeData to write the output and free the resources.
(VRayProfilerSettings)
An optional object, which contains the requested VRayProfiler operational mode, outputDirectory, max depth and other metadata
Tracks a procedure. Duration events are simple events which track the exact time from a moment A to a moment B. This method starts the tracking.
Tracks a procedure. Duration events are simple events which track the exact time from a moment A to a moment B. This method ends the tracking.
Explicitly writes the profiler data, if not already written and deinitializes the profiler.
A group of methods for reading data and creating V-Ray geometry proxies.
Type: Object
Read full proxy geometry data.
((Plugin | ProxyReadParams))
Either an instance of GeomMeshFile plugin, or a ProxyReadParams object to read the file path and parameters from.
(ProxyReadDataFlags?)
Boolean flags defining which parts of the data to read. If omitted, 'all' is assumed.
ProxyReadData
:
The requested data, which was read from the file
var proxyData = Proxy.readFullDataSync(renderer.plugins.mesh_UID000000005A14FDC0);
Read proxy preview data.
((Plugin | ProxyReadParams))
Either an instance of GeomMeshFile plugin, or a ProxyReadParams object to read the file path and parameters from.
(ProxyReadDataFlags?)
Boolean flags defining which parts of the data to read. If omitted, 'all' is assumed.
ProxyReadData
:
The requested data, which was read from the file
var proxyData = Proxy.readPreviewData(renderer.plugins.mesh_UID000000005A14FDC0);
Read full proxy geometry data.
((Plugin | ProxyReadParams))
Either an instance of GeomMeshFile plugin, or a ProxyReadParams object to read the file path and parameters from.
(ProxyReadDataFlags?)
Boolean flags defining which parts of the data to read. If omitted, 'all' is assumed.
(function (err, result: ProxyReadData))
Called when the proxy data is read. The result holds the requested data, which was read from the file
Proxy.readFullData(renderer.plugins.mesh_UID000000005A14FDC0, callback);
Creates a vrmesh file from data stored in multiple plugins or in multiple MeshFileData objects. The plugin types for plugins could be:
((Array<Plugin> | Array<MeshFileData>))
Either an array of plugins supplying the data to combine in the proxy file - see supported plugin types above
or an array of MeshFileData containers supplying the data to combine in the proxy file
(string)
Destination filename (.vrmesh format).
(CombinedProxyFileMeshCreateParams)
(optional) Additional parameters for the created file.
boolean
:
false if an error ocurred.
Creates a .vrmesh file from data stored in a plugin or in a MeshFileData container. The plugin types for plugin could be:
((Plugin | MeshFileData))
Either a plugin supplying the data for the proxy file - see supported plugin types above
or a MeshFileData container supplying the data for the proxy file
(string)
Destination filename (.vrmesh format).
(ProxyFileMeshCreateParams)
(optional) Additional parameters for the created file.
boolean
:
false if an error ocurred.
Read simplified geometry preview data from a proxy file (.vrmesh, .abc)
((Plugin | ProxyReadParams))
Either an instance of GeomMeshFile plugin, or a ProxyReadParams object to read the file path and parameters from.
(number?)
(Alembic only) An optional number of triangles to return. The exact number of elements in 'vertices' may differ slightly.
If countHint is not specified, geomMeshFile.num_preview_faces (params.num_preview_faces) is used.
GeometryData
:
An object containing the data (vertices, indices) or undefined on failure
Read simplified hair preview data from a proxy file (.vrmesh, .abc)
((Plugin | ProxyReadParams))
Either an instance of GeomMeshFile plugin, or a ProxyReadParams object to read the file path and parameters from.
(number?)
(Alembic only) An optional number of triangles to return. The exact number of elements in 'vertices' may differ slightly.
If countHint is not specified, geomMeshFile.num_preview_faces (params.num_preview_faces) is used.
HairData
:
An object containing the preview hair data (vertices, lengths) or undefined on failure
Read simplified particle preview data from a proxy file (.vrmesh, .abc)
((Plugin | ProxyReadParams))
Either an instance of GeomMeshFile plugin, or a ProxyReadParams object to read the file path and parameters from.
(number)
(Alembic only) An optional number of triangles to return. The exact number of elements in 'vertices' may differ slightly.
If countHint is not specified, geomMeshFile.num_preview_faces (params.num_preview_faces) is used.
ParticlesData
:
An object containing positions of the preview subset of all particles or undefined on failure.
Used in Proxy.createMeshFile()
Type: object
(Transform)
: A Transform object for transforming the vertices and normals in 3D space.
(AnimatedTransform)
: An object containing transformations at corresponding keyframes, to be written to the created file
(string)
: A name to associate with the mesh. This can be used to identify the object when reading the proxy.
(number)
: A unique ID for the mesh. This should usually match a Node.objectID value.
(number)
: Target number of triangles in each voxel.
(number)
: Number of preview triangles to generate. Set to 0 to disable preview. (default 10000)
(string)
: One of 'face_sampling', 'clustering', 'edge_collapse' or 'combined' (default).
(boolean)
: True if the mesh is animated.
(number)
: Where to start exporting the animation from.
(number)
: Where to stop exporting the animation.
(string)
: A file name to read and use its vertices and faces for the preview voxel
(boolean)
: Merge all voxels of the same type, before subdivision.
(ColorList)
: Array of diffuse (wire) colors - 1 Color per mesh object
(IntList)
: Array of smoothed flags (1 flag per mesh object - true if the voxel should be rendered with smoothed normals)
(IntList)
: Array of flipNormals flags (1 flag per mesh object - true if the geometric normals should be flipped)
(boolean)
: When enabled, adds a point cloud representation of the mesh separated into different levels of detail. The various levels of detail can be used by proxies for saving memory when rendering distant objects.
(number)
: Determines the size of point cloud disks at the most detailed level. If this value is small, point clouds rendered at the lowest level appear closer to original mesh but use more memory.
(number)
: Number of preview hairs (default 1000)
(number)
: Number of preview particles (default 20000)
(boolean)
: When enabled (default), applies the input Transform(s) to the geometry data, otherwise writes the Transform(s) into separate data channel.
An object containing the data returned by Proxy.readFullData(), Proxy.readFullDataSync() or Proxy.readPreviewData()
Type: object
(VectorList)
: Full mesh vertex positions array
(IntList)
: Indices in the vertex array for each triangle. Every 3 consecutive ints are one triangle.
(VectorList)
: Full mesh normal vectors array.
(IntList)
: Indices in the normal for each triangle. Every 3 consecutive ints are one triangle
(IntList)
: Material IDs for each consecutive triangle in the full mesh
(VectorList)
: Velocity vectors for each vertex in the vertex array
(IntList)
: Array with the original proxy file indices of the UV sets. They may not equal their index in the data arrays here
(Array<VectorList>)
: Array of arrays of UVW mapping coordinates for the given mapping channel index
(Array<IntList>)
: Array of index arrays for the coordinates in uvValues
(IntList)
: IDs of shaders (materials)
(IntList)
: IDs of objects (geometry meshes)
(IntList)
: Array of begin indices of the voxel range of geometry objects (vBegin is included in the range)
(IntList)
: Array of end indices of the voxel range of geometry objects (vEnd is excluded from the range)
(IntList)
: IDs of hair objects
(IntList)
: Array of begin indices of the voxel range of hair objects (vBegin is included in the range)
(IntList)
: Array of end indices of the voxel range of hair objects (vEnd is excluded from the range)
(IntList)
: IDs of particle objects
(IntList)
: Array of begin indices of the voxel range of particle objects (vBegin is included in the range)
(IntList)
: Array of end indices of the voxel range of particle objects (vEnd is excluded from the range)
(VectorList)
: Full array of the hair geometry vertices
(IntList)
: Full array of the hair strands length data (The i-th strand has hairVerticesPerStrand
[
i
]
consecutive vertices in hairVertices)
(VectorList)
: Full array of the particle geometry vertices
(IntList)
: Full array of indices, where the voxel vertices data starts - the i-th voxel starts at vertices[voxelVerticesStartIndices
[
i
]
]
(IntList)
: Full array of indices, where the voxel vertex indices data starts - the i-th voxel starts at vertexIndices[voxelVertexIndicesStartIndices
[
i
]
]
(IntList)
: Full array of indices, where the voxel normals data starts - the i-th voxel starts at normals[voxelNormalsStartIndices
[
i
]
]
(IntList)
: Full array of indices, where the voxel normalIndices data starts - the i-th voxel starts at normalIndices[voxelNormalIndicesStartIndices
[
i
]
]
(IntList)
: Full array of indices, where the voxel materialIDs data starts - the i-th voxel starts at materialIDs[voxelMaterialIDsStartIndices
[
i
]
]
(IntList)
: Full array of indices, where the voxel velocities data starts - the i-th voxel starts at velocities[voxelVelocitiesStartIndices
[
i
]
]
(IntList)
: Full array of indices, where the voxel UV values data starts - the j-th set of the i-th voxel starts at uvValues[voxelUVValuesStartIndices
[
j * geometryVoxels_count + i
]
]
(IntList)
: Full array of indices, where the voxel UV value indices data starts - the j-th set of the i-th voxel starts at uvValueIndices[voxelUVValueIndicesStartIndices
[
j * geometryVoxels_count + i
]
]
(VectorList)
: Full array of bounding boxes of all geometry voxels
(VectorList)
: Full array of bounding boxes of all hair voxels
(VectorList)
: Full array of bounding boxes of all particle voxels
(IntList)
: Full array of indices, where the hair vertices data starts - the i-th hair voxel starts at hairVertices[hairVerticesStartIndices
[
i
]
]
(IntList)
: Full array of indices, where the hair strands data starts - the strands data of the i-th hair voxel starts at hairVerticesPerStrand[hairVerticesPerStrandStartIndices
[
i
]
]
(IntList)
: Full array of indices, where the particle vertices data starts - the i-th particle voxel starts at particleVertices[particleVerticesStartIndices
[
i
]
]
(IntList)
: Array of edge visibility flags, each integer in the array has edge visibility information for 10 consecutive faces (3 bits per face).
(ColorList)
: Array of diffuse (wire) colors - 1 Color per mesh object
(IntList)
: Array of smoothed flags (1 flag per mesh object - true if the voxel should be rendered with smoothed normals)
(IntList)
: Array of flipNormals flags (1 flag per mesh object - true if the geometric normals should be flipped)
(FloatList)
: Full array of the hair geometry widths
(IntList)
: Full array of indices, where the hair widths data starts - the i-th hair voxel starts at hairWidths[hairWidthsStartIndices
[
i
]
]
(FloatList)
: Full array of the particle geometry widths
(IntList)
: Full array of indices, where the particle widths data starts - the i-th particle voxel starts at particleWidths[particleWidthsStartIndices
[
i
]
]
(number)
: The number of frames in the file
(boolean)
: True, in case the currently read frame contains at least one of geometry/hair/particle velocity data
(VectorList)
: Velocity vectors for each vertex in the hairVertices array
(VectorList)
: Velocity vectors for each vertex in the particleVertices array
(IntList)
: Full array of indices, where the hair velocities data starts - the i-th hair voxel starts at hairVelocities[hairVelocitiesStartIndices
[
i
]
]
(IntList)
: Full array of indices, where the particle velocities data starts - the i-th particle voxel starts at particleVelocities[particleVelocitiesStartIndices
[
i
]
]
Boolean flags defining which parts of the data to read. Multiple flags could be true.
Type: object
(boolean)
(boolean)
(boolean)
(boolean)
(boolean)
(boolean)
(boolean)
(boolean)
(boolean)
(boolean)
(boolean)
(boolean)
(boolean)
(boolean)
(boolean)
The necessary parameters for reading data in a proxy file
Type: object
(string)
: file name to read
(string)
: starting object path in Alembic hierarchy
(number)
: true to calculate smooth normals
(number)
: 0 do not rotate; 1 transform from Maya to 3dsMax coordinate system (90 deg. rotation around x axis); 2 transform from 3dsMax to Maya (-90 deg. rotation around x axis)
(number)
: the subdivision level
(number)
: determines the smoothing mode of the mapping channels' borders. 0-None, 1-Internal and 2-All
(number)
: animated proxy playback type(0 - loop; 1 - once; 2 - ping - pong; 3 - still)
(number)
: number of faces in preview
(number)
: smooth angle in degrees
(number)
: animated proxy playback speed
(number)
: animated proxy initial frame offset
(number)
: frames per second for calculation of current time and frame
(boolean)
: read the full path instead of only the name
(boolean)
: true to compute the bounding box, false to read it from the file
(boolean)
: true to subdivide Alembic PolyMesh and SubD objects; false to subdivide only SubD objects
(boolean)
: file name to readsubdivide or skip mapping channels
(boolean)
: if true, the borders won't be subdivided
(boolean)
: turns on/off the instancing of Alembic duplicated objects
(boolean)
: true to use Alembic animation frame offset
(number)
: a multiplier to the hair width data
(number)
: a multiplier to the particle width data
Type: object
(string)
: [
OPTIONAL
]
Specifies additional, non-default plugin library paths to load vray
*.dll (libvray
*.so)
((string | integer))
: Sets the V-Ray Frame Buffer draw style.
(boolean)
: Whether to enable/disable the VFB window creation.
(boolean)
: Sets the frame buffer visibility.
(boolean)
: Gets or sets whether the executing process participates in the rendering.
The default value is true. If only V-Ray slaves are rendering (i.e.
the rendering is out of process), then hosts for distributed rendering
should be specified with the VRayRenderer.AddHosts(String) method
before starting the rendering.
(boolean)
: If set appsdk will not check for render license before rendering is started.
(boolean)
: Disable to inherit parent application GUI theme. Enabled by default.
(boolean)
: Enable to optimize the renderer for small preview purposes.
((string | vray.Language))
: [
OPTIONAL
]
A language code string (from vray.Language) for the VFB
Type: object
(string)
: for EXR format only, one of: 'noCompression', 'runLength', 'zipScanline', 'zipBlock', 'piz', 'pxr24', 'b44', 'b44a', 'dwaa', 'dwab'
(number)
: for EXR format only: either 16 or 32
(boolean)
: unused
(boolean)
: do not write the alpha channel into a separate file
(boolean)
: the current frame number will be appended to the file name(s)
(boolean)
: do not write the alpha channel together with the color data
(boolean)
: only a single channel is written to the file (the current one in vfb)
(boolean)
: do not write the RGB channel into a separate file
(boolean)
: write to EXR as integer data
(boolean)
: unused
(boolean)
: create a single multi-channel file if the file format supports it
(boolean)
: bake the VFB corrections to the output file
Closes the ScannedMaterialInfo
in V-Ray which releases the material
Get information string about the file content.
(string)
The name of the file containing the scanned material data.
string
:
The info string
Get preset values of the scanned material.
(string)
The name of the file containing the scanned material data.
ScannedMaterialPreset
:
Object containing the preset values of the scanned material.
Options to set up a VRayServer.
Type: object
(number)
: Which port to accept connections on (leave at 0 for default - 20207 (DR1) or 20209 (DR2)).
(number)
: Number of threads to use for rendering (leave at 0 for all available).
(string)
: The folder in which the received vrscene-file will be written, default is the temp folder.
(string)
: Alternative path to folder containing V-Ray plugins.
(string)
: Semicolon separated list of file system paths to the folders containing scene include files.
(boolean)
: Do not check if RenderNode license is available when creating the server (it's always checked when rendering is started), default: false.
(boolean)
: Change the current folder to remoteScenePath, default: false.
(boolean)
: Do not write a temporary vrscene-file, keep the scene data in memory only, default: false.
(boolean)
: True to override any local cache settings on the render servers with the value from the client machine. Default: false.
(boolean)
: True to use the underlying renderer as a dr/live-link interface. Default: false.
(number)
: 0 for no limiting; 1 for time limiting; 2 for space limiting. See cachedAssetsLimitValue. Default: 0.
(number)
: Value for the cache limit (hours or GB). Default: 0.0.
(boolean)
: (DR2 only) Whether the instance will act as a Dedicated Dispatcher.
(boolean)
: (DR2 only) (Dispatcher only) Whether the dispatcher should run a local render server
(boolean)
: (DR2 only) Whether SSL/TSL should be enabled for connections from/to this dispatcher/server
(boolean)
: (DR2 only) Whether UDP discovery should be disabled
(boolean)
: (DR2 only) Whether to listen on IPv4 local sockets
(boolean)
: (DR2 only) Whether to listen on IPv6 local sockets
(boolean)
: (DR2 only) Whether to use pipelining. Note pipelining will be disabled internally (even if requested), if a proxy is configured or is discovered between the client and a remote server.
(string)
: (DR2 only) server:port connection parameter for http connections via proxy
(number)
: (DR2 only) Number of worker threads per each server instance we start
(number)
: (DR2 only) Initial connection timeout in seconds
(number)
: (DR2 only) Number of upstream connections, which the client side will use, when pipelining is not enabled
Type: object
The object is a composite of a vray.Matrix and a vray.Vector that represent
an affine transformation. It supports mathematical operations like
multiplication and addition; equality comparison; indexing, where the
matrix is [0] and the offset [1].
This object is immutable.
Available constructors are:
Transform()
Transform(number, number, number, number, number, number, number, number, number, number, number, number)
Transform(number[]|Vector, number[]|Vector, number[]|Vector, number[]|Vector)
Transform(Matrix, number[]|Vector)
Transform(Transform)
An Array-like object that holds transform instances data. It consumes less memory than a js array containing the same transforms. The object is not resizable.
Available constructors:
TransformList()
TransformList({number})
TransformList({FloatList|Float32Array}, {boolean})
TransformList({Transform[]})
TransformList({Transform}, {Transform}, ...)
(FloatList)
: Provides a FloatList view of the TransformList data buffer. Each 12 consecutive floats represent a Transform.
Returns a list of plugin dependency links. Any reference to another plugin from a property (including list property) will append a PluginLink tuple to the list Properties are checked in the order of their definition in the plugin descriptor.
(Plugin)
The plugin to start from
(boolean)
If True, after processing all the properties of one plugin
recursively check the dependency plugins.
Array<PluginLink>
:
Array of objects describing one-to-one plugin relationships
var pluginsUsedByMaterial = Util.getChildPlugins(renderer.plugins.multiMaterial2);
Returns a list of plugins that directly reference the given child plugin.
(Plugin)
The plugin which we is used by "parents"
Array<PluginLink>
:
Array of objects describing one-to-one plugin relationships
var pluginsUsingMaterial = Util.getParentPlugins(renderer.plugins.multiMaterial2);
Returns the prescribed intensity of the light specified in an .ies file.
(string)
The .ies file name full path
float
:
Prescribed intensity defined in the .ies file, or -1 if an error occured
var intensity = Util.getIESPrescribedIntensity(fileName);
Copies some of the specified plugins in the includeListOfPlugins list of the srcRenderer and some of their successors, depending on an exludeListOfPlugins, a user-defined pre-create callback to the dstRenderer and at the end, invoking a user-defined post-create callback on the created plugins after all have been processed. REMARK: if a plugin scheduled to be visited by the preCreateCallback is deleted, it will not be counted as an error and it will be skipped as well as the successors that were attached to it as we have no reference to them. WARNING: One should decide how to handle singleton plugins (plugins which have at most one instance in a scene)! WARNING: We highly recommend that you don't modify plugins (including deletion, clearing the scene etc.) of srcRenderer and dstRenderer for the whole duration of this call! Doing so could lead to unexpected results including crashes. If the includeListOfPlugins is empty, we will invoke the preCreateCallback on all the plugins of the srcRenderer (a part from the rtEngine). If the includeListOfPlugins is non-empty, we will surely invoke the preCreateCallback on all plugins in the list and all successors which have been approved by the preCreateCallback invocations. If the excludeListOfPlugins is empty, it does not affect anything. If the excludeListOfPlugins is non-empty, then the mentioned plugins in it will not be scheduled to be visited by the preCreateCallback (even if they are mentioned explicitly in the includeListOfPlugins or implicitly via relatedness to a plugin mentioned in the includeListOfPlugins) and will surely not be copied. Their successors will also not be scheduled, but are not banned to be scheduled by being in another plugin's successor list. What can you do with the preCreateCallback? You get as arguments the dstRenderer and the srcPlugin. You will return an object which can contain the following properties: - name - A string with which we will try to rename the plugin in the dstRenderer. If it is an empty string, then this plugin creation will be skipped and successors will not be processed. Default is empty string. REMARK: If the "name" field of the object is missing, then the plugin being reviewed will be skipped. - skipOnlyCurrentPlugin - A boolean variable which, if true and combined with the field "name" being an empty string, then the plugin is skipped, but successors will be processed. Default is false. Can be skipped. - skipAllSuccessorsOfCurrentPlugin - A boolean variable which, if true will ensure that no successors of the currently processed plugin will be processed. Default is false. Can be skipped. - overwriteExistingPlugin - A boolean variable which, if set to true, if there is a plugin in the dstRenderer with the same name as the one specified in the field "name", it will try to overwrite it (reusing the existing instance and not recreating it from scratch). Keep in mind that they may not be of the same type, and if it occurs, then the created plugin will have an auto-generated name and the postCreateCallback integer enumerable argument autoRenamedResult will be set to the corresponding value. Default is false. Can be skipped. What can you do with the postCreateCallback? You get as arguments the dstPlugin, srcPluginName, autoRenamedResult and preCreateCallbackReturnedName. Some more information about some of the arguments: - srcPluginName - A string that is the same as srcPlugin name. - autoRenamedResult - An integer constant which is used to indicate how the renaming process has finished. Can be:
<ul>
<li>'vray.Util.NO_AUTO_RENAME' - No automatic renaming has occured.</li>
<li>'vray.Util.NO_OVERWRITE_NO_EXISTING_PLUGIN_BUT_INVALID_PLUGIN_NAME' - We have not set the plugin to be overwritten,
and there isn't a plugin with the same name in the dstRenderer, but the chosen plugin name is invalid.
Hence, the plugin is created, but automatically renamed.</li>
<li>'vray.Util.NO_OVERWRITE_BUT_EXISTING_PLUGIN_WITH_NAME' - We have not set the plugin to be overwritten,
but there is an existing plugin in the dstRenderer with the same name, so we fallback to automatic renaming.</li>
<li>'vray.Util.OVERWRITE_EXISTING_PLUGIN_WITH_NAME_BUT_DIFFERENT_TYPE' - We have set the plugin to be overwritten
if there exists a plugin with the same name in the dstRenderer, but the plugins don't have the same plugin type.
Hence, fallback to automatic renaming.</li>
</ul>
- preCreateCallbackReturnedName - A string that is the same as "name" field in the returned object of the preCreateCallback.
(VRayRenderer)
The source renderer (a valid VRayRenderer object). All plugins in the following lists must be of this renderer.
(VRayRenderer)
The destination renderer (a valid VRayRenderer object).
Copies some of the specified plugins of type (class) pluginType of the srcRenderer and some of their successors, depending on a user-defined pre-create callback to the dstRenderer and at the end, invoking a user-defined post-create callback on the created plugins after all have been processed. REMARK: if a plugin scheduled to be visited by the preCreateCallback is deleted, it will not be counted as an error and it will be skipped as well as the successors that were attached to it as we have no reference to them. WARNING: One should decide how to handle singleton plugins (plugins which have at most one instance in a scene)! WARNING: We highly recommend that you don't modify plugins (including deletion, clearing the scene etc.) of srcRenderer and dstRenderer for the whole duration of this call! Doing so could lead to unexpected results including crashes. What can you do with the preCreateCallback? You get as arguments the dstRenderer and the srcPlugin. You will return an object which can contain the following properties: - name - A string with which we will try to rename the plugin in the dstRenderer. If it is an empty string, then this plugin creation will be skipped and successors will not be processed. Default is empty string. REMARK: If the "name" field of the object is missing, then the plugin being reviewed will be skipped. - skipOnlyCurrentPlugin - A boolean variable which, if true and combined with the field "name" being an empty string, then the plugin is skipped, but successors will be processed. Default is false. Can be skipped. - skipAllSuccessorsOfCurrentPlugin - A boolean variable which, if true will ensure that no successors of the currently processed plugin will be processed. Default is false. Can be skipped. - overwriteExistingPlugin - A boolean variable which, if set to true, if there is a plugin in the dstRenderer with the same name as the one specified in the field "name", it will try to overwrite it (reusing the existing instance and not recreating it from scratch). Keep in mind that they may not be of the same type, and if it occurs, then the created plugin will have an auto-generated name and the postCreateCallback integer enumerable argument autoRenamedResult will be set to the corresponding value. Default is false. Can be skipped. What can you do with the postCreateCallback? You get as arguments the dstPlugin, srcPluginName, autoRenamedResult and preCreateCallbackReturnedName. Some more information about some of the arguments: - srcPluginName - A string that is the same as srcPlugin name. - autoRenamedResult - An integer constant which is used to indicate how the renaming process has finished. Can be:
<ul>
<li>'vray.Util.NO_AUTO_RENAME' - No automatic renaming has occured.</li>
<li>'vray.Util.NO_OVERWRITE_NO_EXISTING_PLUGIN_BUT_INVALID_PLUGIN_NAME' - We have not set the plugin to be overwritten,
and there isn't a plugin with the same name in the dstRenderer, but the chosen plugin name is invalid.
Hence, the plugin is created, but automatically renamed.</li>
<li>'vray.Util.NO_OVERWRITE_BUT_EXISTING_PLUGIN_WITH_NAME' - We have not set the plugin to be overwritten,
but there is an existing plugin in the dstRenderer with the same name, so we fallback to automatic renaming.</li>
<li>'vray.Util.OVERWRITE_EXISTING_PLUGIN_WITH_NAME_BUT_DIFFERENT_TYPE' - We have set the plugin to be overwritten
if there exists a plugin with the same name in the dstRenderer, but the plugins don't have the same plugin type.
Hence, fallback to automatic renaming.</li>
</ul>
- preCreateCallbackReturnedName - A string that is the same as "name" field in the returned object of the preCreateCallback.
(VRayRenderer)
The source renderer (a valid VRayRenderer object). All plugins in the following lists must be of this renderer.
(VRayRenderer)
The destination renderer (a valid VRayRenderer object).
A mathematical vector in 3D space. Supports the usual mathematical operations
including dot and cross products (* and ^). The three components can be
indexed like a list.
This object is immutable.
Available constructors are:
Vector()
Vector(number, number, number)
Vector(number[])
Vector(Vector)
Multiplies the Vector by the given Number, Vector or Matrix and returns new Vector. For Transform, use Transform.mul(Vector). This Vector does not change.
Vector
:
The multiplication as a new Vector
A namespace-like class for VFB related methods. It's associated with one specific VRayRenderer instance and does not affect any other instances.
Type: Object
(boolean)
: Show/hide V-Ray frame buffer.
(boolean)
: Gets/sets whether moving and rotating the scene with the mouse in V-Ray VFB is enabled.
({x: integer, y: integer})
: Get/set the V-Ray VFB window position in screen coordinates.
({width: integer, height: integer})
: Get/set the V-Ray VFB window size in pixels.
(boolean)
: Set the always-on-top state of the V-Ray VFB. No getter available.
(boolean)
: Gets/sets whether a confirmation dialog is shown when clearing the image buffer through the VFB "Clear image" button.
Clears the current image buffer
Set the V-Ray VFB state with data returned from getState (possibly from a previous session).
Reset the VFB as if it was just created. This does not clear the image, use clearImage() for that.
Fill in the lens effects settings from the VFB GUI into the SettingsVFB plugin The plugin is created if it does not already exist in the scene.
(string?)
The name of the new instance if one has to be created. If not set a default autogenerated name is used.
boolean
:
True on success
Load an image from disk into the framebuffer. All image channels are loaded. This is an asynchronous version.
Save the current image buffer as if you used the save button on the VFB. Format is deduced from the filename extension. This method allows you to save in some formats (e.g. TIFF) not supported by the VRayImage class. This is an asynchronous version.
Save the current image buffer as if you used the save button on the VFB. Format is deduced from the filename extension. This method allows you to save in some formats (e.g. TIFF) not supported by the VRayImage class. This is a synchronous blocking version.
(string)
(SaveImageOptions?)
number
:
errorCode
Type: object
(number)
: id of the menu item. Should be greater than or equal to 0
(string)
: type of the menu item. Possible values are "normal" and "checkbox".
(boolean)
: False if the menu should be disabled.
(string)
: Display text of the menu item
(number)
: Initial value of the item. Used only when the type is "checkbox". 0 means cleared and 1 means checked
A namespace-like class for Layer related methods. It's associated with one specific VFBLayerManager instance (VRayRenderer instance) and does not affect any other instances.
Type: Object
Returns the ID of the layer instance. The ID is unique per layer manager contained in a VFB instance. WARNING: It does not verify the validity of the layer! Layers can become invalid (e.g., after a loadAllLayers usage), and not always is the change propagated on time to these handles. For that, use the isValid method.
integer
:
Non-negative number if the layer is valid and -1 otherwise.
Returns the VFBLayerManager instance to which this layer manager belongs.
VFBLayerManager
:
Returns the VFBLayerManager instance to which this layer belongs.
Returns the value of a property as its underlying type.
object
:
Returns the value or undefined upon failure.
Sets the value of a property. For the StampFont type properties which describe a UI font, the object has five fields:
Sets layer opacity, if the layer is blendable.
(float)
The opacity of the layer.
Gets layer blending mode, if the layer is blendable.
Blend modes are available for all Color correction layers, Composite layers, folders, and multiple masks applied on a single layer or folder.
When adding a new layer, it is placed on top of the stack and it is considered the foreground (FG).
The result of all layers below it is considered the background (BG). Layers are applied from the bottom to the top.
Where darker and lighter pixels are mentioned below, it is in relation to mid-grey.
The available values are:
VRayMtlSelect
render element's material and other layers.string
:
The blend mode of the layer.
Sets layer blending mode, if the layer is blendable.
Blend modes are available for all Color correction layers, Composite layers, folders, and multiple masks applied on a single layer or folder.
When adding a new layer, it is placed on top of the stack and it is considered the foreground (FG).
The result of all layers below it is considered the background (BG). Layers are applied from the bottom to the top.
Where darker and lighter pixels are mentioned below, it is in relation to mid-grey.
The available values are, case insensitive:
VRayMtlSelect
render element's material and other layers.(string)
The blend mode of the layer.
Gets the unique path from the root layer to the current layer using their indices as children of their parent layer(indices from the list of children of the parent layer). E.g. '/0/1/0/4' corresponds to root.getChild(0).getChild(1).getChild(0).getChild(4).
string
:
The unique path from the root layer to the current layer.
Returns number of children of the layer.
integer
:
The number of children of the layer.
Returns the number of properties of the given layer.
integer
:
The number of properties of the given layer.
Gets the type of a given property. The return values are:
(string)
The name of the property.
string
:
The layer propery type.
Gets a list of all properties of the layer which are of type "layerType".
(string)
The type by which the layer properties will be filtered by.
Possible values, case insensitive:
Array<string>
:
The list of all layer properties of type "layerType".
Gets the flags of a given property as a list of strings.
It can have values:
(string)
The name of the property.
Array<string>
:
The flags of a given property.
A namespace-like class for VFB Layer management related methods. It's associated with one specific VFB instance (VRayRenderer instance) and does not affect any other instances. Note: if you want to manipulate values related to externally loaded configurations (e.g. OCIO) concerning the Display Corrections layer, the VFB must be loaded and set to the correct profile in order to access the related values. Note: When beginning the rendering, the layers will be reloaded so all layer handles are invalidated. The same is true after every loadAllLayers, setAllLayers. A nice practice is to check whether the layer handle is valid before using it. Note: When beginning a rendering by default the parameters from SettingVFB 'vfb2_layers' and 'cc_settings' are used to overwrite the contents of the Layer Manager. If this is not a desired effect, then you can set the 'dont_affect_settings' parameter of the SettingsVFB plugin in the scene to true (the default value is false). If you don't want to use this parameter, you can use a combination of fillSettingsVFB and applySettingsVFB methods to write the changes of the layers to the vrscene plugin which will be later read when the rendering starts. If you want to work with the VFB layer settings from a loaded vrscene, you must manage the "loading" and "unloading" of those settings (using fillSettingsVFB, applySettingsVFB and the Layer Manager method reset).
Type: Object
(boolean)
: Sets whether the Layer Manager layers settings are going to be used when the rendering with the
VFB is started. By default if there is a SettingsVFB plugin, the parameters 'vfb2_layers' and 'cc_settings'
have higher priority.
Resets all the parameters to their default values. You MUST lock the layer manager and stop image updates in the render view while this function runs. Otherwise the update thread might access the layer tree while it's in an inconsistent state and crash.
Get the number of layers.
integer
:
The number of layers in the layer manager.
Gets the stamp layer.
For this layer there is a specific property called 'stamp_font' which is an object containg the fields pointSize, fontStyle, fontStyle, fontWeight and fontFace. pointSize (Size of text, in points) takes up integer values and fontFace (Name of the font face ("Arial" etc)) can be set to string values having no more than 100 characters.
In particular some of the fields take very concrete string values.
For fontStyle (Describes the family of a UI font) those are, case insensitive:
VFBLayer
:
The stamps layer. If it isn't found, an invalid layer is returned.
Loads all layers from a file. WARNING: After successful usage of this method, all layer instances used before its invocations will become invalid, no matter what the getIntegerID method returns. The isValid method will appropriately return the validity of a layer when in doubt.
(string)
The name of the file.
Saves and returns all layers into a JSON string. WARNING: After successful usage of this method, all layer instances used before its invocations will become invalid, no matter what the getIntegerID method returns. The isValid method will appropriately return the validity of a layer when in doubt.
(string)
The layers as a JSON string.
Creates a new layer of the specified class, attaches it to the specified parent and returns the newly created layer. The following table of rules explains where the new layer will be attached (it may not be a child of the parent specified): DC - Display Correction, CC - Color Correction, PE - Post Effect, Ref - Reference, NA - NOT ALLOWED Rules should be checked from top to bottom as they are in the table. The N field is for reference below. -------------------------------------------------------------------------------------------| N | Selected Type | New Type | Position | ------------------------- |-------------------------|--------------------------------------| 1 | | DisplayCorrection | Last child of Root | 2 | Nothing selected | Folder/ CC/Ext / PE/Ref | Last child of first DC | 9 | Source layer selected | Folder/ CC/Ext / PE/Ref | Use the composite folder as selected | 3 | DC / Folder | Folder/ CC/Ext / PE/Ref | Last child of Selected | 4 | CC/Ext w PE/Ref parent| Folder/ PE / Ref | Directly Above Parent of Selected | 5 | CC/Ext w PE/Ref parent| CC/Ext | Directly Above Selected | 6 | CC/Ext | Folder/CC/Ext/PE/Ref | Directly Above Selected | 16| Ext | CC | Last child of Selected | 7 | Ref | Color Correction | Last child of Selected | 8 | Ref | Folder / PE / Ref | Directly Above Selected | 10| PE | CC/Ext/Folder | Last child of first DC | 11| CC/Ref | Mask | Last mask child of the selected | 12| Mask | Mask | Last mask child of selected parent | 13| | Overlay | Add to root | 14| Overlay | CC/Ext | Last child of first DC | 15| DC | PE | see addPostEffectLayer |
VFBLayer
:
The newly created layer. If it cannot be created, an invalid layer is returned.
Lock the layers critical section - used when need to access the layers and that might happen from different threads. Uses a small number of spin cycles instead of immediately locking, if another thread already owns the critical section.
Unlock the layers critical section.
Returns a list of all devices available for use by the Metal engine. macOS only.
Array<ComputeDeviceInfo>
:
Empty list on failure.
Returns a list of all devices available for use by the Optix engine. Compute capability >= 5.2 is required to use Optix. All unsupported devices will be ignored.
Array<ComputeDeviceInfo>
:
Empty list on failure.
Returns a list of all devices available for use by the CUDA engine. The "CUDA CPU" device uses the CUDA engine code compiled for the x86-64 architecture. It is not the CPU V-Ray engine. It is disabled by default but you can enable it for faster "hybrid" rendering.
Array<ComputeDeviceInfo>
:
Empty list on failure.
Returns a list of all devices available for denoising.
Array<ComputeDeviceInfo>
:
Empty list on failure.
Set which devices to use for rendering with the Metal engine. macOS only.
boolean
:
False if an error occurred.
Set which devices to use for rendering with the Optix engine. Compute capability >= 5.2 is required to use Optix. All unsupported devices will be ignored.
boolean
:
False if an error occurred.
Set which devices to use for rendering with the CUDA engine.
boolean
:
False if an error occurred.
Set which devices to for denoising when GPU denoiser is selected.
(Array<integer>)
The indices of the devices to use as returned by GetComputeDevicesDenoiser
boolean
:
False if an error occurred.
Set the user environment to the currently selected devices for each engine. Note that this will affect other V-Ray products as well.
boolean
:
False if an error occurred.
Creates a VRayServer asynchronously
(ServerOptions?)
The options for the server represented as a JSON object.
(function (err, server)?)
Callback to be called with the server created
Gets the location of the Material Library if it has been installed on the system.
string
:
The path to the Material Library or undefined if it's not installed.
Returns true, if V-Ray is built with DR2 - Distributed Rendering generation 2. Returns false, in case of a DR1 build.
boolean
:
.
Checks if a V-Ray server (host) is running and available to render.
(string)
hostName or hostName:port.
object
:
Status result with properties:
ready {boolen} server ready to accept render requests
status {string} possible values:
"Error Resolve";
"Error Connect";
"Error Timeout";
"Server Ready";
"Server Unknown";
"Server Error";
"Server Busy";
cpuCount {number} the number of virtual CPUs on the server
vrayVersion {string} server V-Ray version number
hostResolved {string} hostName:port translated to ip:port
hostConnectedTo {string} server is busy connected to this ip; available only if status is "Server Busy"
revisionTime {string} the time the server revision is built
Checks if a V-Ray server (host) is running and available to render.
(string)
hostName or hostName:port.
(function (err, result)?)
Called when a result is available.
For more details see the result of checkDRHostSync.
Sets or removes an environment variable. V-Ray uses environment variables to unlock some behaviors and it could be difficult to set them when the host process (Node) uses a runtime different from V-Ray's, specifically on Windows.
(string)
Environment variable name.
(string)
Environment variable new value or null to remove.
boolean
:
true on success.
Gets the value of an environment variable. V-Ray uses environment variables to unlock some behaviors and it could be difficult to set them when the host process (Node) uses a runtime different from V-Ray's, specifically on Windows.
(string)
Environment variable name.
string
:
Environment variable value.
(optional) Completely shuts down V-Ray and releases any used licenses. You can't use V-Ray after this call. This function is dangerous and not needed to be called in most cases.
(optional) Closes all VRayRenderer, VRayServer and ScannedMaterialInfo instances synchronously. It is called internally when the process or a worker thread is exiting.
Before calling other methods, use this to set the path to VRaySDKLibrary.dll, if not on the system PATH
(string)
boolean
:
true on success
var vray = require('vray');
vray.setSDKLibraryPath('c:/appsdk/bin');
console.log(vray.sdkVersionDetails());
Returns detailed error info about SDK library loading errors.
string
:
Returns detailed error info about SDK library loading errors.
Returns an array containing the names of the missing SDK library functions from the imported module.
Array<string>
:
Returns an array containing the names of the missing SDK library functions from the imported module.
Enables or disables V-Ray frame buffer globally. If called before creating a renderer, this prevents initialization of the GUI component entirely There is a separate option 'enableFrameBuffer' for VRayRenderer that only affects the instance.
(boolean)
Encodes the V-Ray scanned material parameters into a binary block to be used as a value of BRDFScanned.param_block property.
(object)
the parameters to be encoded
object
:
paramBlock
the encoded parameters
Obtains scanned materials UI license.
int
:
On success returns the nuber of times this function is called or 0 on failure.
Releases the scanned materials UI license obtained by getScannedMaterialUILicense().
int
:
The number of times left this function must be called to actually release the license.
(equals to the number of successful getScannedMaterialUILicense() for which this function isn't called yet).
Gets the parameters from an .osl or .oso shader file. This is a synchronous blocking call.
(string)
Full path to an .osl or .oso file
Object
:
An object containing all output and input parameters
Gets the parameters from an .osl or .oso shader file.
(string)
Full path to an .osl or .oso file
(function (err, params)?)
Called after the OSL shader has been compiled and the parameters - parsed.
Sets the license server config. This only works while there are no renderers.
(string)
Hostname or IP of primary license server
(number)
default port is 30304
(string?)
Optional fallback license server
(number?)
(string?)
Optional second fallback license server
(number?)
(string?)
Optional http proxy
(number?)
(string?)
Optional login
(string?)
Password for the optional login
(string?)
Login for the optional http proxy
(string?)
Password for the optional http proxy
number
:
0: Success
-1: You can't change server settings while license is engaged
-2: Cannot initialize authentication server. This is an internal error
-3: Cannot find the appropriate method in vray.dll. This is most probably a version mismatch
This should be called before creating a Renderer. Set the name of the USD provider that should be initialized or "none" to disable the initialization.
(string?)
The name of the USD provider.
Creates a VRayRenderer asynchronously
(RendererOptions?)
The options for the renderer represented as a JSON object.
(function (err, renderer)?)
Callback to be called with the renderer created
Specifies the operational mode of the Profiler. One of: "off" | "simple" | "full" | "process". The meaning of the values are:
<ul>
Type: string
The settings passed to the VRayRenderer.setVRayProfiler() interface.
Type: object
((number | VRayProfilerMode))
: VRayProfiler operational mode - 0 ('off'), 1 ('simple'), 2 ('full'), 3 ('process') - or one of the vray.PROFILER
MODE
* constants
(number)
: The maximum ray bounces that will be profiled. Range
[
1, 8
]
.
(string)
: TThe directory where the profiler reports will be created. If nullptr is passed, temp directory is used.
(string)
: The full path to the profiler html template. If this is left empty, the default location will be searched.
(string)
: Name of the host product.
(string)
: Version of the host product.
(string)
: Name of the scene that will be profiled. Used as a suffix to the generated filename.
This class controls the native V-Ray renderer and manages scene contents.
(RendererOptions?)
The options for the renderer represented as a JSON object.
(boolean)
: Apply changes to renderer immediately if True (default)
Otherwise changes are applied only when commit() is called. 'false' is
useful for large batches of changes because it is more efficient to
apply them all at once.
(Object)
: Current renderer options.
(number)
: The number of threads V-Ray will use for rendering. 0 (the default) uses all CPU logical threads.
This will throw an exception if set during rendering.
(boolean)
: Specifies whether the executing process participates in the rendering (when true, default)
or whether the rendering is executed entirely by V-Ray DR render slaves (when false)
This will throw an exception if set during rendering.
({width: integer, height: integer, resetCropRegion: boolean, resetRenderRegion: boolean})
: The output image size(width and height) and flags
for resetting the render region and crop region.
Setting this (creates if necessary and) changes SettingsOutput in the scene.
The size is reset after clearing the scene or loading another scene file.
({left: integer, top: integer, width: integer, height: integer})
: The render region as an object (empty to reset)
Setting this (creates if necessary and) changes SettingsOutput in the scene.
The size is reset after clearing the scene or loading another scene file.
({srcWidth: integer, srcHeight: integer, rgnLeft: number, rgnTop: number, rgnWidth: number, rgnHeight: number})
: The crop region as an object (empty to reset):
The object defines a virtual crop region (rgnLeft, rgnTop, rgnWidth, rgnHeight)
within a virtual source image space with size srcWidth, srcHeight.
Image output size is unchanged (VRayRenderer.size)
Setting this (creates if necessary and) changes SettingsOutput in the scene.
The size is reset after clearing the scene or loading another scene file.
(integer)
: Frame number (int) to render when NOT in sequence mode.
Also affects keyframes when setting animated property values. See useAnimatedValues.
Current frame and current time are related through the 'fps' property
of SettingsOutput. Could not be set during renderSequence.
If read during renderSequence the value will be the next frame to be
rendered after the call to continueSequence.
(integer)
: The time (float) for animated properties.
Current frame and current time are related through the 'fps' property
of SettingsOutput. Could not be set during renderSequence.
If read during renderSequence the value will be the time of the next
frame to be rendered after the call to continueSequence.
(boolean)
: When set to true V-Ray won't quit interactive rendering even if timeout or noise threshold are reached. Defaults to false.
If a noise/time limit is reached, the render engine will become idle, but it will not unload and it will restart sampling
when a scene change is applied. The only way to end the render is to explicitly stop() it.
(boolean)
: When this is true, setting property values will use the current
'time' or 'frame' to create keyframes for animation. Defaults to false.
(boolean)
: Checks if rendering is complete. If it ended in failure or got cancelled, this will still return true.
Notice that an intermediate image may be available from getImage even if this returns false (because rendering is ongoing).
(boolean)
: Gets the status of the sequence rendering process. This is not meaningful if you're not rendering a sequence.
(string)
: Sets the current render mode if the renderer is in an idle state. Defaults to Interactive.
VRayRenderer
uses the Production engine for final quality.VRayRenderer
uses the Production engine for final rendering with CUDA.VRayRenderer
uses GPU for production rendering with Optix.VRayRenderer
uses GPU for production rendering with Metal. macOS only.VRayRenderer
uses CPU for interactive rendering.VRayRenderer
uses GPU for interactive rendering with CUDA (for nVidia GPUs).VRayRenderer
uses GPU for interactive rendering with Optix.VRayRenderer
uses GPU for interactive rendering with Metal. macOS only.(boolean)
: Returns whether interactive rendering is paused. See VRayRenderer.pause and VRayRenderer.resume.
((string | null))
: Camera name override. Current camera is selected internally using the scene_name property of the camera plugins.
(string)
: Returns the current state of the renderer. The available values are:
(boolean)
: True if V-Ray is rendering internally half resolution (the images/data returned are upsampled to full resolution).
False if V-Ray is rendering in full resolution.
(number)
: Get the current value (in seconds) of the relative time used in event callbacks
(integer)
: The minimum importance level of messages that will emit on('logMessage') events.
One of the module constants LOGLEVEL_ERROR, LOGLEVEL_WARNING, LOGLEVEL_INFO, LOGLEVEL_DEBUG.
(string)
: The last error that occurred when a method was called.
(boolean)
: If an image passed in the ProgressiveImageUpdated event parameters is needed.
If not, no unnecessary copies would be made.
(boolean)
: If an image passed in the BucketReady event parameters is needed.
If not, no unnecessary copies would be made.
(Object<string, Class>)
: Returns an object with V-Ray class name and V-Ray class (plugin type) pairs.
(Object<string, Category>)
: Returns an object with V-Ray class category name and V-Ray class category pairs.
(RenderElements)
: Returns render elements wrapper object.
(VFB)
: Returns a VFB wrapper object with methods related to the VFB.
VRayRenderer
:
V-Ray renderer
var renderer = new vray.VRayRenderer();
Starts the rendering process in a secondary thread. This is a synchronous blocking call.
Begins rendering an animation sequence in a separate thread. A non-blocking call
Resumes sequence rendering with the next frame.
Exports the currently loaded scene to the specified text file. The export serializes all plugins in text format. This is an asynchronous version.
(string)
The path to the file where the scene will be exported. The file path must contain the name of the
destination file. The export will not add a ".vrscene" extension to the file name if it is missing.
(ExportSettings?)
Optional settings for the export operation. The settings specify how and what type of scene elements are exported.
(function (error)?)
Callback to be called when the export finishes. Receives Error or null
Exports the currently loaded scene to the specified text file. The export serializes all plugins in text format. This is a synchronous blocking version.
(string)
The path to the file where the scene will be exported. The file path must contain the name of the
destination file. The export will not add a ".vrscene" extension to the file name if it is missing.
(ExportSettings?)
Optional settings for the export operation. The settings specify how and what type of scene elements are exported.
integer
:
errorCode
Serializes the whole scene (plugins with their property values) contained in the renderer into a single memory stream no matter if they originate from a loaded or appended vrscene file or are created by code. The whole stream will be always transferred when DR hosts are connected. No DR hosts should have been connected before serialization. (Currently only one type of serialization is supported but other types may be added in the future.) This method is here mainly for debug purposes but it can be helpful in some other cases as well. Do not use it unless you know exactly what you're doing.
boolean
:
Returns true on success and false on failure
NOTE: Available in DR1 only Toggles distributed rendering on or off. This can only be done when the renderer is idle. When this is disabled (default) it saves some memory. When it is enabled remote render machines added with addHosts() will be connected and contribute to the render.
(boolean)
True to enable the DR subsystem.
(boolean)
Only when drEnabled=true: Whether a socket will be created to listen for remote machine broadcast messages over LAN.
boolean
:
True on success, False if this failed, e.g. when a render is already running or V-Ray failed to initialize its DR subsystem.
NOTE: Available in DR2 only Toggles on the current VRayRenderer to act as a DR2 client.
(EnableDRClientParams)
An optional object, which contains the dispatcher string and other extra parameters.
In case of an empty dispatcher string or no parameters passed, local dispatcher will be used.
boolean
:
True on success, False if this failed, e.g. when a render is already running or V-Ray failed to initialize its DR subsystem.
Adds hosts to the renderer for distributed rendering. There is also an async version addHosts
number
:
-2: Failed to resolve hostname or an empty/null string was passed
-1: Renderer is invalid or in the PREPARING state
0: Hosts were added to the list, but failed to connect
1: Hosts were successfully added and connected if rendering was in progress
2: Hosts were successfully added to the list, but weren't connected due to lack of work
var resultCode = renderer.addHostsSync('10.0.0.32', '10.0.4.34:1234');
Removes hosts from the renderer for distributed rendering. This is a synchronous blocking call.
boolean
:
True on success
var success = renderer.removeHostsSync(["10.0.4.33", "10.0.4.34:1234"]);
Resets the hosts list for distributed rendering. If rendering is in process, hosts that are not on the new list are disconnected. This is a synchronous blocking call.
(err | null)
:
Null or exception - Usually you don't throw on this exception.
It just tells you if there're errors removing some hosts.
var success = renderer.resetHostsSync(["10.0.4.33", "10.0.4.34:1234"]);
Adds hosts to the renderer for distributed rendering.
(function (err)?)
Called when all hosts have been resolved and
connected (if possible).
renderer.addHosts('10.0.0.32', '10.0.4.34:1234', function(err) {});
Removes hosts from the renderer for distributed rendering.
(function (err)?)
Called when all hosts have been resolved and
removed (if possible).
renderer.removeHosts(["10.0.4.33", "10.0.4.34:1234"], function(err) {});
Resets the hosts list for distributed rendering. If rendering is in process, hosts that are not on the new list are disconnected.
(function (err)?)
Called when the hosts have been resolved and
removed (if possible).
renderer.resetHosts(["10.0.4.33", "10.0.4.34:1234"], function(err) {});
Gets an array of strings formatted as ip:port pairs for all active and inactive rendering hosts.
(function (hosts))
Called when the result is ready. The only argument of the
callback is an array of strings containing the result.
renderer.getAllHosts(function(hosts) { console.log(hosts); });
Gets an array of strings formatted as ip:port pairs for all active rendering hosts.
(function (activeHosts))
Called when the result is ready. The only argument of the
callback is an array of strings containing the result.
renderer.getActiveHosts(function(activeHosts) { console.log(activeHosts); });
Gets an array of strings formatted as ip:port pairs for all inactive rendering hosts.
(function (inactiveHosts))
Called when the result is ready. The only argument of the
callback is an array of strings containing the result.
renderer.getInactiveHosts(function(inactiveHosts) { console.log(inactiveHosts); });
In Production mode the method provides the coordinates for a nearby bucket to be rendered. If the selected bucket has already been rendered, a closest bucket will be picked with a minimum distance to the specified coordinates. The coordinates must be within the dimensions of the currently rendered image, otherwise the method has no effect. The method has also no effect in progressive modes.
Return the first scene Node object intersected at the given pixel.
Return the first scene Node object intersected at the given pixel. This is a synchronous blocking call.
(number)
Image space X.
(number)
Image space Y.
(number?)
Maximum time to perform the intersection in milliseconds.
vray.Plugin
:
The return value is a vray.Plugin (of type Node) or undefined.
Return the scene Node objects intersected at the given pixel.
(number)
Image space X.
(number)
Image space Y.
(number?)
The maximal number of plugins to obtain (0 - no limitation).
(number?)
Maximum time to perform the intersection in milliseconds.
(function (Array<PickedPluginInfo>))
Called when the result is ready. The only argument of the
callback is an array of PickedPluginInfo objects.
Return the scene Node objects intersected at the given pixel. This is a synchronous blocking call.
(number)
Image space X.
(number)
Image space Y.
(number?)
The maximal number of plugins to obtain (0 - no limitation).
(number?)
Maximum time to perform the intersection in milliseconds.
Array<PickedPluginInfo>
:
The return value is an array of PickedPluginInfo objects.
Waits for the rendering to finish. If timeout is specified, waits no more than the timeout. After this the callback function is called. The parameters can be in any order.
(integer?)
Timeout value in milliseconds.
No value or -1 will wait to the end of rendering (idle state) or to
awaiting changes state if keepInteractiveRunning has been set.
A value of -2 will wait to the end of rendering (idle state).
(function (err))
renderer.waitForRenderEnd(10000, function() {
renderer.stop();
renderer.vfb.saveImage('result.png');
renderer.close();
});
Waits for rendering of an animation sequence to finish. This is a non-blocking call.
(integer?)
The timeout in milliseconds after which the waiting terminates if the sequenced is not finished in the meantime.
(function (boolean))
Callback called with True if the sequence has been finished, False if timeout or error occurred.
Sets the maximum difference threshold between 2 intermediate images returned by V-Ray during progressive rendering to be used as a criterion when to send the current image in the callback event.
(float)
The new value
float
:
The old value.
Sets the maximum timeout interval (in milliseconds) during V-Ray progressive rendering to send the current image in the callback even if the difference criteria is not met.
(integer)
Timeout value in milliseconds.
integer
:
The old value in milliseconds.
Sets maximum paths per pixel when using the interactive engine. Value 0 means unlimited. This (creates if necessary and) changes SettingsRTEngine in the scene. The setting is reset after clearing the scene or loading another scene file.
(number)
Maximum samples to take per pixel before render ends
boolean
:
True on success
Set noise threshold for a frame when using interactive mode. Value 0 means unlimited. This (creates if necessary and) changes SettingsRTEngine in the scene. The setting is reset after clearing the scene or loading another scene file.
(number)
End sampling when the noise is at or below this level for all pixels (value 0.001 or higher)
boolean
:
True on success
Set a timeout value (in milliseconds) for a frame when using interactive mode. Value 0 means unlimited. This (creates if necessary and) changes SettingsRTEngine in the scene. The setting is reset after clearing the scene or loading another scene file.
(number)
Rendering will end after this time elapses
boolean
:
True on success
Related to animations - clears the values of all properties up to the given time only from plugins of the given categories.
boolean
:
Returns true on success and false on failure
Gets the current image from renderer. WARNING: If Nvidia AI upscaling is enabled, then the returned image/data will have even dimentions.
(object?)
Name | Description |
---|---|
options.left integer
|
left pixel border of the region to get (default 0) |
options.top integer
|
top pixel border of the region to get (default 0) |
options.width integer
|
width of the region to get (default full width) |
options.height integer
|
height of the region to get (default full width) |
options.doColorCorrect boolean
|
if true, VFB color corrections will be applied (default false) |
options.stripAlpha boolean
|
if true, the alpha channel will be set to 1.0 (default false) |
options.flipImage boolean
|
if true, the image will be flipped upside down (default false) |
VRayImage
:
Returns a copy of the current image.
var image = renderer.getImage();
image.save('image.jpg', function(err) {});
Returns the whole scene bounding box excluding infinite primitives.
Returns interactive renderer statistics.
InteractiveStatistics
:
InteractiveStatistics on success or null on failure.
Pauses interactive rendering.
Resumes interactive rendering.
Clear last error.
Returns a list of all devices available for use by the Metal engine. macOS only.
Array<ComputeDeviceInfo>
:
Empty list on failure.
Returns a list of all devices available for use by the Optix engine. Compute capability >= 5.2 is required to use Optix. All unsupported devices will be ignored.
Array<ComputeDeviceInfo>
:
Empty list on failure.
Returns a list of all devices available for use by the CUDA engine. The "CUDA CPU" device uses the CUDA engine code compiled for the x86-64 architecture. It is not the CPU V-Ray engine. It is disabled by default but you can enable it for faster "hybrid" rendering.
Array<ComputeDeviceInfo>
:
Empty list on failure.
Returns a list of all devices available for denoising.
Array<ComputeDeviceInfo>
:
Empty list on failure.
Set which devices to use for rendering with the Metal engine. macOS only.
boolean
:
False if an error occurred.
Set which devices to use for rendering with the Optix engine. Compute capability >= 5.2 is required to use Optix. All unsupported devices will be ignored.
boolean
:
False if an error occurred.
Set which devices to use for rendering with the CUDA engine.
boolean
:
False if an error occurred.
Enable or disable resumable production rendering. This has to be called before starting a render.
(boolean)
(object?)
Name | Description |
---|---|
params.outputFile string
|
resumable file name. Obligatory if SettingsOutput.img_file is not set |
params.compressProgressiveFiles boolean
|
whether to compress .vrprog file when rendering with progressive sampling |
params.progressiveAutoSaveSeconds integer
|
how often to save a checkpoint when rendering with progressive sampling |
boolean
:
false on failure
Cache bitmaps between renders. If enabled, bitmap textures will be stored in memory and won't be unloaded / loaded again on the next render. This may save a lot of time loading heavy textures before every render.
(boolean)
Enable / disable bitmap texture cache. Disabling cache will clear cached data.
boolean
:
true if cache interfaces were added; false - otherwise.
Explicitly starts the denoiser. Requires a RenderChannelDenoiser instance in the scene. This can be run while rendering is ongoing or when it's paused or after it is stopped. Denoising parameters are taken from the RenderChannelDenoiser plugin. The denoising is run asynchronously, so this function will return as soon as the thread is started. When denoising is done the postEffectsUpdated callback will be called.
(function (img: Image))
Optional callback function to be called when denoising finishes. Passes the image from the VFB.
(boolean)
Optional flag whether an image should be passed to the callback function. Default is true (pass image).
Set to false if you don't need the image, for performance and memory improvement.
boolean
:
true if the denoising thread is started successfully and false if there is a problem with the parameters or renderer state
Invokes an update to the lighting analysis render element. Requires RenderChannelLightingAnalysis to be present in the scene. This can be run while rendering is ongoing or when it's paused or after it is stopped. Lighting analysis parameters are taken from the RenderChannelLightingAnalysis plugin. The update is asynchronous, so the funtion will return as soon as the thread is started. When the channel is updated the postEffectsUpdated callback will be called.
boolean
:
true if the thread is started successfully and false if there is a problem with the parameters or renderer state.
Loads the specified V-Ray scene file (.vrscene) into memory. Previous scene contents are wiped. The file can be exported from a previous session with this SDK or from V-Ray for 3dsMax, Maya, etc. A callback function is called for each plugin before it is created in memory. The user can decide whether he wants the plugin to be created or not and whether he wants to change its name. This is a synchronous blocking version.
(string)
The file path to the .vrscene file which will be loaded.
Loads the specified V-Ray scene data into memory. Previous scene contents are wiped. A callback function is called for each plugin before it is created in memory. The user can decide whether he wants the plugin to be created or not and whether he wants to change its name. This is a synchronous blocking version.
Appends the specified scene file data to the currently loaded scene without wiping it. A callback function is called for each plugin before it is created in memory. The user can decide whether he wants the plugin to be created or not and whether he wants to change its name. This is a synchronous blocking version.
Appends the specified scene data to the currently loaded scene without wiping it. A callback function is called for each plugin before it is created in memory. The user can decide whether he wants the plugin to be created or not and whether he wants to change its name. This is a synchronous blocking version.
Appends the specified scene data to the currently loaded scene without wiping it. A callback function is called for each plugin before it is created in memory. The user can decide whether he wants the plugin to be created or not and whether he wants to change its name. Unlike appendAsTextFilteredSync this function uses the data contained in the buffers directly without first copying it. This is a synchronous blocking version.
Loads the specified V-Ray scene file (.vrscene) into memory. Previous scene contents are wiped. The file can be exported from a previous session with this SDK or from V-Ray for 3dsMax, Maya, etc. A callback function is called for each plugin before it is created in memory. The user can decide whether he wants the plugin to be created or not and whether he wants to change its name.
Loads the specified V-Ray scene data into memory. Previous scene contents are wiped. A callback function is called for each plugin before it is created in memory. The user can decide whether he wants the plugin to be created or not and whether he wants to change its name.
Appends the specified scene file data to the currently loaded scene without wiping it. A callback function is called for each plugin before it is created in memory. The user can decide whether he wants the plugin to be created or not and whether he wants to change its name.
(function (error))
The callback function is called when the loading is finished.
Appends the specified scene data to the currently loaded scene without wiping it. A callback function is called for each plugin before it is created in memory. The user can decide whether he wants the plugin to be created or not and whether he wants to change its name.
(function (error))
The callback function is called when the loading is finished.
Appends the specified scene data to the currently loaded scene without wiping it. A callback function is called for each plugin before it is created in memory. The user can decide whether he wants the plugin to be created or not and whether he wants to change its name. Unlike appendAsTextFiltered this function uses the data contained in the buffers directly without first copying it.
(function (error))
The callback function is called when the loading is finished.
Set search paths for scene include files.
Returns the auto-exposure("autoExposure") and auto-white balance("autoWhiteBalance") values computed during the last light cache calculation, and the ISO value("ISO") for a V-Ray Physical Camera, which corresponds to the value, when auto exposure is enabled. When a value is 0, this means that the calculation is not enabled.
Sets up the VRay Profiler. Should be called as early as possible (e.g. before rendering start), otherwise it will have no effect.
(VRayProfilerSettings)
An optional object, which contains the requested VRayProfiler operational mode, outputDirectory, max depth and other metadata
Add a key-value pair to VRay Profiler metadata. Should be called as early as possible before setVRayProfiler, otherwise it will have no effect.
(string)
a key to which the key-value pair will be added
(string)
a preferably unique identifier. If duplicated the last value entry will be set to correspond to this key
(string)
the value to the corresponding key
boolean
:
True if the key-value pair has been successfully added and false if there was a problem
Selection for Debug Shading Isolate Selected mode.
Returns an native handle (pointer) of this VRayRenderer instance.
The returned handle allows sharing the VRayRenderer instance among different
programming languages and/or shared libraries in the same process.
The VRayRenderer
constructor also accepts this handle type in order
to create shared VRayRenderer instance.
Use with extreme caution! Do not use unless you know exactly what you're doing!
External
:
Prevents the garbage collector from reclaiming this renderer instance until it's explicitly closed. This will also prevent nodejs from exiting.
renderer.keepAlive();
Closes the VRayRenderer
in V-Ray which stops the
rendering process and releases all resources associated with it.
Once closed, a VRayRenderer instance cannot be used anymore.
If the optional callback is not provided, this function is synchronous
and may have a significant performance impact.
(function ()?)
Optional callback to be called when the renderer has been closed
renderer.close(function() { console.log('Renderer has been closed'); });
Initializes some settings plugins to recommended values. Call on an empty scene before your own changes. This should be done before applying your own settings and before starting a render. The values are better than the defaults. The defaults remain as they are for compatibility reasons. To see what got changed, export the scene after that to a file and inspect it.
(string?)
Amount of sampling to perform - tradeoff between render time and noise. One of 'draft', 'low', 'medium', 'high', 'veryHigh'
boolean
:
True on success
Loads a scene file (*.vrscene) which can be exported from 3Ds Max, Maya etc.
(string)
Relative or absolute name of the file with the V-Ray scene.
(function (err)?)
Called when the scene is loaded.
renderer.load('/scenes/scene.vrscene', function(err) {
if (err) throw err;
renderer.start();
});
Appends the scene file data to the currently loaded scene.
(function (err)?)
Called after the data has been appended.
(boolean?)
Indicates whether the whole file should be sent to the DR hosts or the name only.
This is not taken into account if there are multiple scenes to append.
renderer.append('/scenes/sceneAppend.vrscene', function(err) {});
Appends the scene text data to the currently loaded scene.
Loads a scene file (*.vrscene) which can be exported from 3Ds Max, Maya etc. This is a synchronous blocking call.
(string)
Relative or absolute name of the file with the V-Ray scene.
(boolean?)
Indicates whether the whole file should be sent to the DR hosts or the name only.
var success = renderer.loadSync('/scenes/scene.vrscene');
Appends the scene file data to the currently loaded scene.
(boolean?)
Indicates whether the whole file should be sent to the DR hosts or the name only.
This is not taken into account if there are multiple scenes to append.
renderer.appendSync('/scenes/sceneAppend.vrscene');
Appends the scene text data to the currently loaded scene. This is a synchronous blocking call.
Loads a scene text data which can be exported from 3Ds Max, Maya etc. Unlike loadAsText this function doesn't copy the text data before passing it to V-Ray but uses the data contained in the buffer directly.
(function (err)?)
Called when the scene is loaded.
Appends the scene text data to the currently loaded scene. Unlike appendAsText this function doesn't copy the text data before passing it to V-Ray but uses the data contained in the buffers directly.
(function (err)?)
Called when the scene is loaded.
Loads a scene text data which can be exported from 3Ds Max, Maya etc. Unlike loadAsTextSync this function doesn't copy the text data before passing it to V-Ray but uses the data contained in the buffer directly. Synchronous blocking version. Throws an Error object on error.
Appends the scene text data to the currently loaded scene. Unlike appendAsTextSync this function doesn't copy the text data before passing it to V-Ray but uses the data contained in the buffer directly. Synchronous blocking version. Throws an Error object on error.
Deletes multiple plugins, faster than deleting them one by one. If any removal fails, it continues with the rest of the plugins.
(function (boolean))
Callback to be called after deletion.
One boolean argument: True if all deletions were successfull, False otherwise.
Called when the renderer state changes. This is used to detect image completion/failure etc. The possible states are:
(function (oldState, newState, instant))
oldState, string - the state before the event
newState, string - new state as of the time of the event ocurrence
instant, number - relative time of the event
renderer.on('stateChanged', function(oldState, newState, instant) {
console.log('Renderer state changed: ', oldState, ' -> ', newState);
});
Called when V-Ray produces a new progressively updated image (when not using buckets).
(function (VRayImage, changeIndex, pass, instant))
image, VRayImage - a copy of the image buffer at the time of the update
changeIndex, number - A linearly growing index reflecting the number of changes applied to the scene in interactive mode. Corresponds to value returned by commit().
pass, number - which render pass generated the image. See RENDER
PASS
* constants (0=final, 1=LC, 2=IM).
instant, number - relative time of the event
renderer.on('progressiveImageUpdated', function(VRayImage, changeIndex, pass, instant) {
console.log('Image updated.');
});
Called when a new bucket is issued for rendering by V-Ray.
(function (region, pass, instant))
region, BucketRegion
pass, number - which render pass generated the bucket. See RENDER
PASS
* constants (0=final, 1=LC, 2=IM).
instant, number - relative time of the event
renderer.on('bucketInit', function(region, pass, instant) {
console.log('New bucket being rendered at', region);
});
Called when a bucket has failed rendering.
(function (region, pass, instant))
region, BucketRegion
pass, number - which render pass generated the bucket. See RENDER
PASS
* constants (0=final, 1=LC, 2=IM).
instant, number - relative time of the event
renderer.on('bucketFailed', function(region, pass, instant) {
console.log('A bucket has failed rendering at', region);
});
Called when a bucket has been rendered.
(function (bucket, pass, instant))
bucket, BucketImage or region, BucketRegion
pass, number - which render pass generated the bucket. See RENDER
PASS
* constants (0=final, 1=LC, 2=IM).
instant, number - relative time of the event
renderer.on('bucketReady', function(bucket, pass, instant) {
console.log('Bucket is ready.');
});
Called when a new message from V-Ray is received. There are three types of messages - info, warning and error messages.
(function (str, level, instant))
message, string - The message text
level, number - The type of the message (0=error, 1=warning, 2=info, 3=debug)
instant, number - relative time of the event
renderer.on('logMessage', function(message, level, instant) {
console.log(message);
});
Called when V-Ray encounters a licensing error (in its rendering thread).
(function (message, errorCode, userStatus, instant))
message, string - The error message for the callback.
errorCode, number - The exact error code reported from the license query.
userStatus, string - The current user log-in status.
The possible values are:
renderer.on('licenseError', function(message, errorCode, userStatus, instant) {
console.log(message);
});
Called when item of the rendering process is ready.
(function (message, progress, total, instant))
message, string - The caption of the current task
progress, number - work completed so far
total, number - total amount of work for the task
instant, number - relative time of the event
renderer.on('progress', function(msg, progress, total, instant) {
console.log("Progress:", msg, (100*progress/total).toFixed(2) + '%');
});
Sets a callback to be executed when the 'transform' or 'fov' property of RenderView has been changed. This can be used to intercept user camera control through the VFB.
(function (propName, instant))
propName, string - name of the RenderView property that has been changed
instant, number - relative time of the event
Sets a callback to be executed when the RenderLast button in VFB has been pressed. The button does nothing by default. You can call start here.
(function (isRendering, instant))
isRendering, bool - whether there was a rendering in progress when the button was pressed
instant, number - relative time of the event
Sets a callback to be executed when the RenderInteractive button in VFB has been pressed. The button does nothing by default. You can call start here.
(function (isRendering, instant))
isRendering, bool - whether there was a rendering in progress when the button was pressed
instant, number - relative time of the event
Sets a callback to be executed when the close button in VFB is pressed.
(function (instant))
instant, number - relative time of the event
Set a callback to be executed when the "Duplicate to host frame buffer" button is clicked.
(function (instant))
isRendering, bool - whether there was a rendering in progress when the button was pressed
instant, number - relative time of the event
Sets a callback to be executed when a post-processed image is available. Lens effects and Denoising can be performed periodically during rendering and this callback allows you to get the images from the prespective channel when they are ready.
(function (instant))
instant, number - relative time of the event
Called when the message window button in the VFB is clicked.
(function (instant))
instant, number - relative time of the event
renderer.on('vfbShowMessagesWindow', function(instant) {
console.log("showing message window.");
});
Called when a DR host is connected.
(function (hostname))
hostname, string - The hostname/ip address and port of the host
instant, number - relative time of the event
renderer.on('hostConnected', function(hostname, instant) {
console.log(hostname, "connected!");
});
Called when a DR host is disconnected.
(function (hostname))
hostname, string - The hostname/ip address and port of the host
instant, number - relative time of the event
renderer.on('hostDisonnected', function(hostname, instant) {
console.log(hostname, "disconnected!");
});
Called when transfer to scene button is pressed in the VFB.
(function (changes, count))
changes - an array holding the light mix change objects
count - number of changes
Each LightMixChange object contains:
renderer.on('lightMixTransferToScene', function(changes,count) {
changes.forEach(c => console.log(`[${c.plugin?c.plugin.name:"Rest"}]:\t${c.intensityMult.toFixed(2)},\t${c.colorMult}`));
});
Called when Upload To Collaboration button is pressed in the VFB.
(function (fileList, e))
fileList, array - an array holding the file paths to the images that should be uploaded.
e, object - has a boolean field "shouldDelete" which you can set to true if you want the files to be deleted or false, if you want to keep them.
renderer.on('uploadToCollaboration', function(fileList, e) {
fileList.forEach(f => console.log(f));
e.shouldDelete = false;
});
Called when the button "Add 'Render Element' to the scene" is pressed in the VFB. The button doesn't do anything by default.
(function (type, instant, e))
type, string - type of the render element. Can be:
<ul>
<li>"lightmix"</li>
<li>"denoiser"</li>
</ul>
instant, number - relative time of the event
e, object - has a boolean field "isSuccessful" which you can set to true on success and false on an error.
renderer.on('vfbAddRenderElementToScene', function(type, instant, e) {
console.log(instant);
e.isSuccessful = true;
});
Sets a callback to be executed when the VFB Pause IPR button is pressed. The button pauses the rendering by default.
(function (instant))
isRendering, bool - whether there was a rendering in progress when the button was pressed
instant, number - relative time of the event
Sets a callback to be executed when the VFB Update IPR button is pressed. The button restarts the rendering by default.
(function (isRendering, instant))
isRendering, bool - whether there was a rendering in progress when the button was pressed
instant, number - relative time of the event
typedef {object} ScannedMaterialPreset
(number)
: ClearCoat index of reflection
(integer)
: Plain materials strategy
(number)
: Bump multiplier for the inclined views
(number)
: The z-value of the view vector below which bump is gradualy applied
(number)
: Displacement multiplier
(number)
: Clear coat noise-like bump amount (there is separate hmap bump)
(number)
: Clear coat glossiness the inverse angle deviation width (60 is one degree), since 20.04.21 this is real preset, but the old materials use specbell\n"
(number)
: Clear coat glossiness variation (0-none 1-the shallow anglesare glossy), since 20.04.21 this is real preset, but the old materials use scratchdens\n"
(number)
: Clear coat effect multiplier
(number)
: Height multiplier for self shadowing
(number)
: Brightness multiplier for self shadowing
(integer)
: Used to render materials with sharp sparks, a procedural map with relative size this param is used to feed the RR sampling
(integer)
: Controls how to use the smooth brdf model
(number)
: CC specular highlights, inverse bell width (60 is one degree)
(number)
: Controls the pure reflective behavior for inclined angles, a feature typical for brushed metal
(number)
: Used mostly with top view fabrics, modifies the rendering of the inclined views making them blurred and fuzzy
(number)
: Used in top view materials to control the light direction correction
(number)
: When flakes is nonzero (spark mode) this parameter specifies to not scramble the uv coordinates
(number)
: Multiplier of the indirect light, used to handle the fluorescent materials by putting value below 1 in this member
(number)
(number)
: The sample thickness in mm, used to introduce alpha/translucency correction of thick materials
(number)
: Used to force triplanar mapping when certain customer has old vray (luxottica)
(number)
: Value used to control the function converting translucency to transparency
(number)
: The large feature map physical size
Creates a V-Ray server instance.
(ServerOptions?)
The options for the server represented as a JSON object.
(number)
: The minimum importance level of messages that will emit on('logMessage') events.
One of the module constants LOGLEVEL_ERROR, LOGLEVEL_WARNING, LOGLEVEL_INFO, LOGLEVEL_DEBUG.
VRayServer
:
var server = vray.VRayServer({portNumber: 8888});
Runs the server in a separate thread.
Closes the server. It becomes unusable after this.
(function ()?)
Optional callback to be called when the renderer has been closed
server.close(function() { console.log('Server has been closed'); });
Stops the server
NOTE: Available in DR2 only Adds hosts to the dispatcher for distributed rendering. There is also an async version addHosts
number
:
-2: Failed to resolve hostname or an empty/null string was passed
-1: Renderer is invalid or in the PREPARING state
0: Hosts were added to the list, but failed to connect
1: Hosts were successfully added and connected if rendering was in progress
2: Hosts were successfully added to the list, but weren't connected due to lack of work
var resultCode = dispatcher.addHostsSync('10.0.0.32', '10.0.4.34:1234');
NOTE: Available in DR2 only Removes hosts from the dispatcher for distributed rendering. This is a synchronous blocking call.
boolean
:
True on success
var success = dispatcher.removeHostsSync(["10.0.4.33", "10.0.4.34:1234"]);
NOTE: Available in DR2 only Resets the hosts list for distributed rendering. If rendering is in process, hosts that are not on the new list are disconnected. This is a synchronous blocking call.
(err | null)
:
Null or exception - Usually you don't throw on this exception.
It just tells you if there're errors removing some hosts.
var success = dispatcher.resetHostsSync(["10.0.4.33", "10.0.4.34:1234"]);
NOTE: Available in DR2 only Adds hosts to the dispatcher for distributed rendering.
(function (err)?)
Called when all hosts have been resolved and
connected (if possible).
dispatcher.addHosts('10.0.0.32', '10.0.4.34:1234', function(err) {});
NOTE: Available in DR2 only Removes hosts from the dispatcher for distributed rendering.
(function (err)?)
Called when all hosts have been resolved and
removed (if possible).
dispatcher.removeHosts(["10.0.4.33", "10.0.4.34:1234"], function(err) {});
NOTE: Available in DR2 only Resets the hosts list for distributed rendering. If rendering is in process, hosts that are not on the new list are disconnected.
(function (err)?)
Called when the hosts have been resolved and
removed (if possible).
dispatcher.resetHosts(["10.0.4.33", "10.0.4.34:1234"], function(err) {});
Gets an array of strings formatted as ip:port pairs for all active and inactive rendering hosts.
(function (hosts))
Called when the result is ready. The only argument of the
callback is an array of strings containing the result.
dispatcher.getAllHosts(function(hosts) { console.log(hosts); });
Gets an array of strings formatted as ip:port pairs for all active rendering hosts.
(function (activeHosts))
Called when the result is ready. The only argument of the
callback is an array of strings containing the result.
dispatcher.getActiveHosts(function(activeHosts) { console.log(activeHosts); });
Gets an array of strings formatted as ip:port pairs for all inactive rendering hosts.
(function (inactiveHosts))
Called when the result is ready. The only argument of the
callback is an array of strings containing the result.
dispatcher.getInactiveHosts(function(inactiveHosts) { console.log(inactiveHosts); });
Called when rendering on this server starts.
(function (instant))
server.on('start', function(instant) {
console.log('V-Ray server started');
});
Called when a renderer attaches to the port of the server. The callback receives a string "host" parameter.
(function (host, instant))
server.on('connect', function(host, instant) {
console.log('Render client connected:', host);
});
Called when a renderer detaches from the port of the server.
(function (instant))
server.on('disconnect', function(host, instant) {
console.log('Render client disconnected:', host);
});
Called when a new message from V-Ray server is received. The three types of messages are info, warning and error.
(function (str, level, instant))
server.on('logMessage', function(message, level, instant) {
console.log(message);
});
Called when item of the rendering process is ready.
(function (message, progress, total, instant))
The callback function has three arguments - the first one is String -
the progress message text; the second and third are integers
- the number of processed items and the total number of items
server.on('progress', function(msg, progress, total, instant) {
console.log("Progress:", msg, (100*progress/total).toFixed(2) + '%');
});
A node::Buffer::FreeCallback passed when creating a node::Buffer::New (with data allocated from v8::ArrayBuffer::Allocator or VRaySDKLibrary)
A node::Buffer::FreeCallback passed when creating a node::Buffer::New (with data allocated with v8::ArrayBuffer::Allocator or malloc)
Used when we need a node::Buffer object (with data allocated from VRaySDKLibrary), e.g. to return it from a function
Used when we need a node::Buffer object (with data allocated with malloc), e.g. to return it from a function
Used to get a v8::ArrayBuffer object reference (with data allocated from VRaySDKLibrary) and pass it to other interfaces, e.g. v8::Int32Array::New
Used to get a v8::ArrayBuffer object reference (with data allocated with malloc) and pass it to other interfaces, e.g. v8::Int32Array::New
Used to get a v8::ArrayBuffer object reference, in case we don't pass a ptr to externally allocated data - the data is allocated from the node::Buffer itself
Used to get the data ptr and the byte length of a v8::TypedArray
Represents a V-Ray image. Supports many conversion functions. Allows direct access to the contained pixel data.
Loads compressed file to a V-Ray image synchronously. Supported formats: png, jpg, bmp, exr, hdr, sgi/rgb/rgba, pic, tiff, tga, psd, dds This is a blocking call. Throws exception on failure.
(string)
The name of the file.
VRayImage
:
The loaded image
var img = vray.VRayImage.loadSync('image.jpg');
Loads compressed file to a V-Ray image. Supported formats: png, jpg, bmp, exr, hdr, sgi/rgb/rgba, pic, tiff, tga, psd, dds
(string)
The name of the file.
(function (err, img)?)
A callback function to be called after the file is saved. The arguments are an error exception object (if any)
and the loaded VRayImage.
vray.VRayImage.load('image.jpg', function(err, img) {
if (err) {
throw err;
}
console.log('Image is loaded.');
});
Helper method to get image size from a file synchronously. Supported formats: png, jpg, bmp, exr, hdr, sgi/rgb/rgba, pic, tiff, tga, psd, dds This is a blocking call. Throws exception on failure.
(string)
The name of the file.
ImageSize
:
The image sizes
var size = vray.VRayImage.loadSizeSync('image.jpg');
console.log(`The image is ${size.width}x${size.height}px`);
Helper method to get image size from a file. Supported formats: png, jpg, bmp, exr, hdr, sgi/rgb/rgba, pic, tiff, tga, psd, dds
(string)
The name of the file.
(function (err, w, h)?)
A callback function to be called after the file is saved. The arguments are an error exception object (if any),
the width and the height of the image.
vray.VRayImage.loadSize('image.jpg', function(err, w, h) {
if (err) {
throw err;
}
console.log(`The image is ${w}x${h}px`);
});
Closes the image and releases image bytes. After an image has been closed you can no longer use its methods. It is not obligatory to close the image and you can leave it to the garbage collector but it is a good practice if you use many images and do not need the old ones. All array buffer views, which includes the Float32Arrays returned by getPixelData() and all other views created from them, if any, are neutered which means their length is set to zero and they become unusable.
Saves the V-Ray image to the specified file compressed in the specified format.
(string)
The name of the file.
(string?)
Can be 'bmp', 'png', 'jpg' ('jpeg'), 'tif' ('tiff') or 'exr'. Not required
if the type can be determined from the filename extension.
(integer
= 0
)
The value of the parameter is an integer value between 0 and 100.
Used for the jpeg format.
(boolean?)
Used only for png and bmp formats.
(integer?)
Possible values: 8, 16 or 32.
Used only for tiff format.
(VRayRenderer?)
If there are warnings and/or errors during the compression process,
they will be emitted via dumpMessage event in the supplied renderer.
(function (err)?)
A callback function to be called after the file is saved. The only
optional argument is an error exception object.
image.save('image.jpg', function(err) {
if (err) {
throw err;
}
console.log('Image is saved.');
});
Compresses the V-Ray image to the specified format.
(string)
Can be 'bmp', 'png' or 'jpg' ('jpeg'). Not required
if the type can be determined from the filename extension.
(integer
= 0
)
The value of the parameter is an integer value between 0 and 100.
Used for the jpeg format.
(boolean?)
Used only for png and bmp formats.
(VRayRenderer?)
If there are warnings and/or errors during the compression process,
they will be emitted via dumpMessage event in the supplied renderer.
(function (err, buf)?)
A callback function to be called after the file compression has
finished. The first argument is an exception error object. The
second argument is a buffer which accepts the compressed image
bytes.
image.compress('png', function(err, buf) {
if (err) throw err;
// use buf here
});
Creates a new V-Ray image which is a resized version of the current.
(integer)
(integer)
(function (image))
A callback function to be called after the scaling is done.
The only argument of the callback is the new resized image.
image.getResized(180, 180, function(newImage) {
newImage.save('resized.jpg', function(err) {});
});
Creates a new V-Ray image which is a downscaled version of the current. The new image dimensions cannot be greater than the source image dimensions. Note that resize() doesn't have this restriction.
(integer)
(integer)
(function (image))
A callback function to be called after the scaling is done.
The only argument of the callback is the new downscaled image.
image.getDownscaled(180, 180, function(newImage) {
newImage.save('downscaled.jpg', function(err) {});
});
Gets a new resized image that fits into a rectangle with the given dimensions, touching it inside. This method preserves the image aspect ratio.
(integer)
The width of the rectangle.
(integer)
The height of the rectangle.
(function (image))
A callback function that is called after the scaling is done.
The only argumet of the callback is the new image.
image.getFitIn(180, 180, function(newImage) {
newImage.save('fit.jpg', function(err) {});
});
Creates a new resized VRayImage preserving source aspect ratio and touching the specified rectangle from outside.
(integer)
The width of the rectangle.
(integer)
The height of the rectangle.
(function (image))
A callback function that is called after the scaling is done.
The only argumet of the callback is the new image.
image.getFitOut(180, 180, function(newImage) {
newImage.save('fit.jpg', function(err) {});
});
Get a new resized image preserving the image width/height ratio so that one of its sides is equal to the corresponding size passed in and the other is greater or equal to the other passed size. Then the image is cropped to fit the required size.
(integer)
(integer)
(function (image))
A callback function that is called after the scaling is done.
The only argumet of the callback is the new image.
image.getCutIn(180, 180, function(newImage) {
newImage.save('cut.jpg', function(err) {});
});
Creates a new downscaled VRayImage from a region in the source image space.\n" Note that cropAndResize() can both downscale and upscale.
(integer)
left border pixel coordinate (in image space) of the cropped source region\n"
(integer)
top border pixel coordinate (in image space) of the cropped source region\n"
(integer)
pixel width of the cropped source region\n"
(integer)
pixel height of the cropped source region\n"
(integer)
target width in pixels\n"
(integer)
target height in pixels
(function (image))
A callback function to be called after the scaling is done.
The only argument of the callback is the new downscaled image.
Creates a new resized VRayImage from a region in the source image space.\n"
(integer)
left border pixel coordinate (in image space) of the cropped source region\n"
(integer)
top border pixel coordinate (in image space) of the cropped source region\n"
(integer)
pixel width of the cropped source region\n"
(integer)
pixel height of the cropped source region\n"
(integer)
target width in pixels\n"
(integer)
target height in pixels
(function (image))
A callback function to be called after the scaling is done.
The only argument of the callback is the new resized image.
Returns a new image which is cropped from this one.
(integer)
(integer)
(integer)
(integer)
VRayImage
:
var newImage = image.getCropped(10, 20, 30, 40);
newImage.save('crop.jpg', function(err) {});
Creates a new V-Ray image which is a downscaled version of the current one synchronously. The new image dimensions cannot be greater than the source image dimensions. Note that resizeSync() does not have this restriction. This is a blocking call.
(integer)
(integer)
VRayImage
:
The new downscaled image.
var newImage = image.getDownscaledSync(180, 180);
newImage.save('downscaled.jpg');
Creates a new V-Ray image which is a resized/rescaled version of the current one synchronously. This is a blocking call.
(integer)
(integer)
VRayImage
:
The new resized image.
var newImage = image.getResizedSync(180, 180);
newImage.save('resized.jpg');
Gets a new resized image that fits into a rectangle with the given dimensions, touching it inside. This method preserves the image aspect ratio. This is a synchronous blocking call.
(integer)
(integer)
VRayImage
:
var newImage = image.getFitInSync(180, 180);
newImage.save('fit.jpg');
Creates a new downscaled VRayImage preserving source aspect ratio and touching the specified rectangle from outside. This is a synchronous blocking call.
(integer)
(integer)
VRayImage
:
var newImage = image.getFitOutSync(180, 180);
newImage.save('fit.jpg');
Get a new resized image preserving the image width/height ratio so that one of its sides is equal to the corresponding size passed in and the other is greater or equal to the other passed size. Then the image is cropped to fit the required size. This is a synchronous blocking call.
(integer)
(integer)
VRayImage
:
var newImage = image.getCutInSync(180, 180);
newImage.save('cut.jpg', function(err) {});
Creates a new downscaled VRayImage from a region in the source one.\n" This is a synchronous blocking call.
(integer)
left border pixel coordinate (in image space) of the cropped source region\n"
(integer)
top border pixel coordinate (in image space) of the cropped source region\n"
(integer)
pixel width of the cropped source region\n"
(integer)
pixel height of the cropped source region\n"
(integer)
target width in pixels\n"
(integer)
target height in pixels
VRayImage
:
The downscaled image.
Creates a new resized VRayImage from a region in the source one.\n" This is a synchronous blocking call.
(integer)
left border pixel coordinate (in image space) of the cropped source region\n"
(integer)
top border pixel coordinate (in image space) of the cropped source region\n"
(integer)
pixel width of the cropped source region\n"
(integer)
pixel height of the cropped source region\n"
(integer)
target width in pixels\n"
(integer)
target height in pixels
VRayImage
:
The downscaled image.
Saves the V-Ray image to the specified file compressed in the specified format synchronously. This is a blocking call. Throws exception on failure.
(string)
The name of the file.
(string?)
Can be 'bmp', 'png', 'jpg' ('jpeg'), 'tif' ('tiff') or 'exr'. Not required
if the type can be determined from the filename extension.
(integer
= 0
)
The value of the parameter is an integer value between 0 and 100.
Used for the jpeg format.
(boolean?)
Used only for png and bmp formats.
(integer?)
Possible values: 8, 16 or 32.
Used only for tiff format.
(VRayRenderer?)
If there are warnings and/or errors during the compression process,
they will be emitted via dumpMessage event in the supplied renderer.
image.saveSync('image.jpg');
Compresses the V-Ray image to the specified format synchronously. This is a blocking call.
(string)
Can be 'bmp', 'png' or 'jpg' ('jpeg'). Not required
if the type can be determined from the filename extension.
(integer
= 0
)
The value of the parameter is an integer value between 0 and 100.
Used for the jpeg format.
(boolean?)
Used only for png and bmp formats.
(VRayRenderer?)
If there are warnings and/or errors during the compression process,
they will be emitted via dumpMessage event in the supplied renderer.
buffer
:
A buffer containing the compressed image bytes.
var imageBytes = image.compressSync('png');
Returns a Float32Array/FloatList view of this image data.
Float32Array
:
This image pixel data. Each consecutive 4 floats represent a pixel/AColor.
Draws the passed image over this one.
(VRayImage)
(integer?)
The horizontal position from which the image is to be drawn.
If missing, the 'x' property from the passed image will be used
if available. (BucketImage has 'x' property.)
(integer?)
The vertical position from which the image is to be drawn.
If missing, the 'y' property from the passed image will be used
if available. (BucketImage has 'y' property.)
(string?)
An optional drawing mode string:
"copy" - overwrite destination image pixels with the source image pixels (default),
"blendFast" - alpha-blend using only the source image alpha but keep the original destination image alpha unchanged.
boolean
:
true on success.
image.draw(img, 30, 40);
Changes the gamma of this image. Note that this is a color correction, not a color space conversion. Output color space conversion is applied automatically according to the value of the gamma property when saving or compressing the image (sRGB if gamma=2.2 or any arbitrary gamma)
(float)
Gamma value from 0 to +inf.
boolean
:
true on success.
image.changeGamma(1.2); // make this image lighter
Applies or removes an sRGB correction curve to/from this image. Note that this changes the underlying float values and it is NOT needed when saving or compressing to 8 or 16-bit formats. Output color space conversion is applied automatically according to the value of the gamma property when saving or compressing the image (sRGB if gamma=2.2 or any arbitrary gamma)
(boolean)
true (default) - apply sRGB, false - remove sRGB.
boolean
:
true on success.
image.changeSRGB(); // apply sRGB to all float color values
Read 8-bit bitmap data from this image (without BMP headers). Default channel order is BGR, no alpha, top-bottom.
(object?)
Name | Description |
---|---|
options.preserveAlpha boolean
|
Include the alpha channel in the resultant bitmap. false - BGR/RGB (bytes_per_pixel = 3), true - BGRA/RGBA (bytes_per_pixel = 4). |
options.swapChannels boolean
|
Swap red and blue channel. false/default - BGR(A), true - RGB(A). |
options.reverseY boolean
|
Reverse Y-axis. false/default - fill top-bottom bitmap, true - fill bottom-top bitmap. |
(any)
{int}
The byte offset between the beginning of two consecutive rows of the output bitmap.
if (stride > 0) use max(stride, width
bytes_per_pixel).
if (stride== 0) use width
bytes_per_pixel rounded up to the smallest factor of 4 (this the default for BMP).
if (stride < 0) use width*bytes_per_pixel rounded up to the smallest factor of -stride; -stride must be a power of 2.
(any)
Force the alpha channel to the given value in the
[
0, 255
]
range. Forces BGRA/RGBA format.
Uint8ClampedArray
:
The requested bitmap data.
var bitmapData = image.toBitmapData({ reverseY: true });
Creates an IntList from the image data that can be directly assigned to RawBitmapBuffer.pixels
(any)
{string|int}
'bgra' (or 'bgra_byte' or 0) (default)
'bgr' (or 'bgr_byte' or 4)
'rgba16' (or 'rgba_16bit' or 3)
'rgba32' (or 'rgba_float' or 1) - sRGB or gamma won't be applied automatically
(any)
Force the alpha channel to the given value in the
[
0, 255
]
range. Forces BGRA/RGBA format.
IntList
:
The requested pixel data.
var intList = image.toIntList('bgr');
typedef {object} BBoxAndVerticesAndFaceIndices
(boolean)
: If true, the convex hull data is needed for the preview. Otherwise, only the bounding box. Always present.
(Box)
: Bounding box of the luminaire. Always present.
((VectorList | Float32Array))
: Vertices of light's convex hull. Optional.
((IntList | Int32Array))
: Vertex indices of the convex hull in consecutive triplets. Optional.
Represents a bucket region object. The (x, y) position represents the upper left coordinate of the bucket matrix.
Type: Object
(integer)
: The top left X coordinate of the rendered bucket region.
(integer)
: The top left Y coordinate of the renderd bucket region.
(integer)
: The actual width of the rendered bucket region.
(integer)
: The actual height of the rendered bucket region.
(string)
: The name of the host that does the rendering for the bucket region.
An object containing the data returned by Proxy.readPreviewGeometry()
Type: object
((VectorList | Float32Array))
: Output vertex preview data. The array can be passed on directly to DirectX/OpenGL etc. (and the indices too)
((IntList | Int32Array))
: Output face index data. Each three consecutive elements make up one triangle
An object containing the hair data returned by Proxy.readPreviewHair()
Type: object
((VectorList | Float32Array))
: Output vertex preview data. Consecutive vertices form hair strands. The i-th strand has lengths
[
i
]
consecutive vertices
((IntList | Int32Array))
: Output hair strand length data. Each strand can have a different number of vertices
An object containing the data returned by Proxy.readPreviewParticles()
Type: object
((VectorList | Float32Array))
: Output particle preview data. The positions of the preview subset of all particles
A convenience class that wraps Plugin instances which toggle (by their presence in the scene) the computation of render elements. It provides the only way to access the image data from these channels. The VRayRenderer class has direct access only to the RGB/Alpha channel.
(string)
: Render element display name string, read-only.
(string)
: Render element type string, read-only.
(string)
: Render element binary format string, read-only.
See RenderElements.getAvailableBinaryFormats for a list.
(string)
: Render element default pixel format string, read-only.
See RenderElements.getAvailablePixelFormats for a list.
(Plugin)
: Returns the plugin instance representing the render element. Might be invalid for special channels like EffectsResult.
Return a memoryview of the current contents of this render element. WARNING: If Nvidia AI upscaling is enabled, then the returned image/data will have even dimentions.
(object?)
Name | Description |
---|---|
options.x number
|
left border pixel coordinate (in image space) of the crop region. Valid only when all 4 (x,y,width,height) values are passed. |
options.y number
|
top border pixel coordinate (in image space) of the crop region. Valid only when all 4 (x,y,width,height) values are passed. |
options.width number
|
pixel width of the crop region. Valid only when all 4 (x,y,width,height) values are passed. |
options.height number
|
pixel height of the crop region. Valid only when all 4 (x,y,width,height) values are passed. |
options.layerIndex number
|
index for multi-image channels such as Cryptomatte |
options.alphaChannelPlugin plugin
|
the plugin describing the alpha channel render element |
options.pixelFormat string
|
The pixel format in which the data is to be returned. See RenderElements.getAvailablePixelFormats for a list of strings that can be set. |
options.rgbOrder boolean
|
The byte order in which the data is to be returned. false for BGR, true for RGB. |
NodeBuffer
:
Return a copy of the current contents of this render element as buffer.
Return a new VRayImage copy of the current contents of this render element. WARNING: If Nvidia AI upscaling is enabled, then the returned image/data will have even dimentions.
(number)
left border pixel coordinate (in image space) of the crop region
(number)
top border pixel coordinate (in image space) of the crop region
(number)
pixel width of the crop region
(number)
pixel height of the crop region
(number?)
index for multi-image channels such as Cryptomatte
(boolean?)
apply VFB color corrections; default if omitted
VRayImage
:
Return an image containing a copy of the current contents of this render element.
A namespace-like class that contains methods for manipulation of V-Ray render elements (a.k.a channels).
Add a render element of the specified type (see getAvailableTypes).
(string)
one of the strings returned by getAvailableTypes
(string)
the name to set to the plugin instance
(string)
the name as seen in the VFB channel list
RenderElement
:
Returns the new render element.
Get one existing render element of the specified type.
(string)
one of the strings returned by getAvailableTypes
RenderElement
:
Returns the render element.
Get a list with all existing render elements of a specified type or all types if no type is given.
(string)
one of the strings returned by getAvailableTypes
Array<RenderElement>
:
Returns all render elements of the type, if specified.