This page provides information on how to control the V-Ray Frame Buffer programmatically.

Page Contents ×

Overview


The VFB can be controlled programmatically in two ways: the first is using various environment variables, and the second is using the vray vfbControl command.

 

From MEL script


The vray vfbControl command modifies the various aspects of the VFB. Commands follow the following structure:

vray vfbControl <flag>;
vray vfbControl <flag> <argument>;

 

For example, to turn off the red channel in the VFB, type

vray vfbControl -red false;

 

To see a list of available options, run one of the following commands:

vray vfbControl;
vray vfbControl help;
vray vfbControl -help;

 

To open up or hide the VFB, use the following MEL commands:

vray showVFB;
vray hideVFB;

MEL Flags


Below is a list of available options. Note the following about these commands:

  • Arguments listed as Boolean can only receive true/false values. These options turn a feature on (true) or off (false). Acceptable values are 0, 1, on, off, yes, no, true, false, enable, and disable.
  • Remember that float values include a decimal, while integers do not. This means that integers can be used when a float is required, but float values cannot be used where integers are required.
  • String values must be enclosed in double quotes.
  • Available values from enumerated lists are presented with a pipe (|) separator. For example, 0 | 1 | 2 means the argument value can only be a 0, 1, or 2. String values of this argument type are input with quote marks.
  • Successfully loading a file or setting a numerical value implicitly enables the corresponding option. For example, using -setregion to set a region for rendering automatically turns on region rendering. If you want to disable a feature, do it after running the load/set command.
  • Options with Set/Get will return the current values for the parameter when used without arguments.

 

VFB Toolbar Options

FlagDescriptionArgumentsSet/GetExample
help
-help

Displays options for the vray vfbControl command.

The help lines will also print when vray vfbControl is called without any flags.

N/A

vray vfbControl;

vray vfbControl help;

vray vfbControl -help;

-rgb
-red
-green
-blue
-alpha
-mono

Enables/disables the corresponding VFB channel.Boolean

yes

vray vfbControl -alpha true; // shows the alpha channel

vray vfbControl -alpha 1; // shows the alpha channel

vray vfbControl -alpha false; // disables alpha channel display

vray vfbControl -alpha 0; // disables alpha channel display

-trackmouseEnables/disables the Track mouse while rendering feature.Booleanyesvray vfbControl -trackmouse 1; //enables "track mouse"
-linkpdpEnables/disables the Link VFB to PDPlayer feature.Booleanyesvray vfbControl -linkpdp 1; //enables VFB to PDPlayer link
-swapabEnables/disables the Swap A/B feature.Booleanyes 
-setcompareabEnables/disables the Compare horizontal and Compare vertical features.h | hor | horizontal
v | ver | vertical
 vray vfbControl -setcompareab h;
-loadimageLoads the specified image in VFB.String (filename) vray vfbControl -loadimage "C:/Temp/image.jpg";
-saveimageSaves the VFB RGB color channel as an image.String (filename) vray vfbControl -saveimage "C:/Temp/image.jpg";
-saveallimageSaves all VFB render channels to separate images or a single vrimg file.String (filename) vray vfbControl -saveallimage "C:/Temp/image.jpg";
-savemultiimageSaves a multichannel .exr or .vrimg file with all VFB render channels inside.String (filename) vray vfbControl -savemultiimage "C:/Temp/image.exr";
-setregionSets the render region in pixels or resets/disables the render region.Integers (left top right bottom)
reset
 vray vfbControl -setregion 0 0 640 480; vray vfbControl -setregion reset;
-setregionrelSets the render region in coordinates, relative to the image resolution [0-1].Floats (left top right bottom) vray vfbControl -setregionrel 0 0 0.5 0.5;
-getregionReturns the current coordinates (left top right bottom) of the render region.N/A vray vfbControl -getregion; // Result: 0 0 500 350
-setregionenabledEnables/disables the render region.Boolean vray vfbControl -setregionenabled 1; //enables the region
-clearimageClears the VFB image.N/A vray vfbControl -clearimage;
-testresolutionenabledEnables/disables the Test resolution opton in the VFB.Booleanyesvray vfbControl -testresolutionenabled 1; //Enables test resolution
-testresolutionA zero-based index between 0 and 7 which sets the test resolution respectively to: 10%, 25%, 50%, 75%, 100%, 110%, 125% and 150% of the original image resolution.Integer (0 to 7)yes

vray vfbControl -testresolution 2; // Sets the test resolution to 50%

vray vfbControl -testresolution; //Result 2 //

-duplicateDuplicates the VFB image to the Maya Render View window.N/A vray vfbControl -duplicate;
-getchannelnamesReturns a string[]. Indices correspond with -get/setchannel.N/A  
-getchannelReturns the index of the current channel in string[0].N/A 

vray vfbControl -getchannel;

//Result: 0 when viewing RGB Color

//Result: 1 when viewing Alpha

// the index increments for each next channel viewed in the VFB, for example render elements are stored after the RGB and Alpha.

-setchannelSelects the render element channel with an index.IntegerSet

vray vfbControl -setchannel 0;

// Switches to the channel at index 0. If viewing a render element, this will switch the display to the RGB Color (at index 0 by default)

VFB Color Correction Options

FlagDescriptionArgumentsSet/GetExample
-clampEnables/disables the Force color clamping feature.Booleanyes
-viewclampEnables/disables displaying the clamped colors in the VFB.Booleanyes 
-infoOpens/closes the Pixel information window.Booleanyes 
-showhistoryEnables/disables the VFB History window.Booleanyes 
-pixelaspectEnables/disables visualization of the pixel aspect ratio.Booleanyes 
-exposureEnables/disables Exposure correction.Booleanyes 
-whitebalanceEnables/disables White Balance correction.Booleanyes 
-huesatEnables/disables Hue/Saturation correction.Booleanyes 
-colorbalanceEnables/disables Color Balance correction.Booleanyes 
-levelsEnables/disables Levels correction.Booleanyes 
-curveEnables/disables Curve correction.Booleanyes 
-bkgrEnables/disables Background Image correction.Booleanyes 
-lutEnables/disables LUT correction.Booleanyes 
-ocioEnables/disables OCIO correction.Booleanyes 
-iccEnables/disables ICC correction.Booleanyes 
-srgbEnables/disables displaying the image in sRGB color space.Booleanyes 
-lutin2logConverts to log space before applying LUT.Booleanyes 
-ccociovtSets OCIO View Transform by number in the dropdown list.Integeryes 
-ccocioicsSets OCIO Input Colorspace by number in the dropdown list.Integeryes 
-ccocioddSets OCIO Display Device by number in the dropdown list.Integeryes 
-ocioinputcolorspaceSets OCIO Input Colorspace by name.Stringyes 
-ociodisplaydeviceSets OCIO Display Device by name.Stringyes 
-ocioviewtransformSets OCIO View Transform by name.Stringyes 
-itemsociocsReturns a list of all available OCIO Input Colorspace values.N/A  
-itemsocioddReturns a list of all available OCIO Display Device values.N/A  
-itemsociovtReturns a list of all available OCIO View Transform values.N/A  
-itemsiccriReturns a list of all available ICC Rendering Intent values.N/A  
-colorbalancemodeSets the Color Balance mode with an integer
0 - All
1 - Shadows
2 - Midtones
3 - Highlights
0 | 1 | 2 | 3yesvray vfbControl -colorbalancemode 3;
-colorbalancevalueSets the Color Balance vector (values for Cyan, Magenta, and Yellow).Integers | Floats (cyan magenta yellow)yesvray vfbControl -colorbalancevalue 0.2 0 0.1;
-huesaturationvalueSets the Hue/Saturation vector (values for Hue, Saturation, and Brightness).Integers | Floats (hue saturation brightness)yes 
-stereoSets the Stereo value with an integer
0 - Inactive
1 - Red/cyan mode
2 - Green/magenta mode
Boolean
0 | 1 | 2
red | cyan | green | magenta
yesvray vfbControl -stereo 2; vray vfbControl -stereo cyan;
-cclevels_rgb
-cclevels_red
-cclevels_green
-cclevels_blue
Enables/disables color components in Levels correction.Booleanyes 
-bkgrimgasforegr Enables/disables the use of Background correction image as foreground.Booleanyes 
-cciccblackpointEnables/disables ICC black point compression.Booleanyes 
-cciccrenderintent

Specifies ICC render intent with an integer:
1 - Perceptual
2 - Relative colorimetric
3 - Saturation
4 - Absolute colorimetric

1 | 2 | 3 | 4yes 
-setexposureSets the Exposure value.Float  
-setcontrastSets the Contrast value.Float  
-setlevelsminSets the Levels min value.Float  
-setlevelsmaxSets the Levels max value.Float  
-setwhitebalancevalSets the White Balance Temperature value.Float  
-getexposureReturns the Exposure Float value.N/A  
-getcontrastReturns the Contrast Float value.N/A  
-getlevelsminReturns the Levels min Float value.N/A  
-getlevelsmaxReturns the Levels max Float value.N/A  
-getwhitebalancevalReturns the White Balance Temperature Float value.N/A  
-loadbkgrimageSpecifies file for Background image correction.String (filename)  
-loadlutSpecifies file for LUT correction.String (filename)  
-loadocioSpecifies file for OCIO correction.String (filename)  
-loadiccSpecifies file for ICC correction.String (filename)  
-loadcurveLoad Curve shape from the specified .bcurve file.
String (filename)  
-savecurveSave Curve shape in the specified .bcurve file.String (filename)  
-loadpresetLoads a global preset file.String (filename)  
-savepresetSaves a global preset file.String (filename)  
-loadccpresetLoads the settings for a specific color correction rollout.String (filename)  
-saveccpresetSaves the settings for a specific color correction rollout.String (filename)  
-resetcc
-resetccexp
-resetccwb
-resetcchsl
-resetccbal
-resetcclvl
-resetcccrv
-resetcclut
-resetccicc
-resetccocio
-resetccbgimg
Resets parameters from corresponding Correction Control rollouts to default values.N/A 

vray vfbControl -resetcc;
//Resets all correction control parameters

 
vray vfbControl -resetccbal;
//Resets only parameters in Color Balance rollout

-bkgrimgfile
-lutfile
-iccfile
-ociofile
Returns the filename String used in the corresponding Correction Control rollout.N/A  


VFB History

FlagDescriptionArgumentsSet/GetExample
-historyShows/hides the VFB history in the History panel.Booleanyes
-historymaxsizeReturns/specifies the size of the VFB History in MB.Integer

yes

 
-historyselectSelects an image in the VFB History (0-based index) for use with additional commands in this section.Integer vray vfbControl -historyselect 2;
-historyload
-historysave
-historyseta
-historysetb
-historyremove

Performs an operation on the History image that was selected with the -historyselect flag.

N/A 

vray vfbControl -historyselect 2 ;
// Required before the next command

vray vfbControl -historyseta;
// sets the selected image as image A for A/B comparison in the VFB

-historyclearDeletes all images from the VFB History.N/A  
-historytemppathReturns/specifies the path used for the History Directory.String (path)yes 
-historycomment

Adds a comment to the History image that was selected with the -historyselect tag.

String (comment)yes 

Lens Effects

FlagDescriptionArgumentsSet/GetExample
-bloomEnables/disables the Bloom Effect.Booleanyesvray vfbControl -bloom true;
-glareEnables/disables the Glare Effect.Boolean

yes

-bloomfillEnables/disables the Bloom Fill Edges option.Booleanyes 
-glarefillEnables/disables the Glare Fill Edges option.Booleanyes 
-bloommodeSpecifies if the bloom will be applied to the RGB image, stored in a separate render element, or both.image | both | renderelemyesvray vfbControl -bloommode image;
-glaretypeSpecifies how the glare is computed. It can be computed from the image, render camera, or camera parameters.
image | rendercam | camparamsyes 
-glaremodeDetermines if the glare effect will be applied to the final image, stored into a separate render element, or both.image | both | renderelemyes 
-bloomweightSets the Bloom Weight value.Floatyes 
-bloomsizeSets the Bloom Size value.Floatyes 
-bloomshapeSets the Bloom Shape value.Floatyes 
-glareweightSets the Glare Weight value.Floatyes 
-glaresizeSets the Glare Size value.Floatyes 
-bloomintensityEnables/disables the Bloom Mask Intensity option.Booleanyes 
-bloomobjectEnables/disables the Bloom Mask Object ID option.Booleanyes 
-bloommaterialEnables/disables the Bloom Mask Material ID option.Booleanyes 
-glareintensityEnables/disables the Glare Mask Intensity option.Booleanyes 
-glareobjectEnables/disables the Glare Mask Object ID option.Booleanyes 
-glarematerialEnables/disables the Glare Mask Material ID option.Booleanyes 
-bloomsetintensitySets the Bloom Mask Intensity value.Float  
-glaresetintensitySets the Glare Mask Intensity value.Float  
-bloomgetintensityReturns the Bloom Mask Intensity Float value.N/A  
-glaregetintensityReturns the Glare Mask Intensity Float value.N/A  
-bloomsetobjectSets the Bloom Mask Object ID value.Integer  
-bloomsetmaterialSets the Bloom Mask Material ID value.Integer  
-glaresetobjectSets the Glare Mask Object ID value.Integer  
-glaresetmaterialSets the Glare Mask Material ID value.Integer  
-bloomgetobjectReturns the Bloom Mask Object ID Integer value.N/A  
-bloomgetmaterialReturns the Bloom Mask Material ID Integer value.N/A  
-glaregetobjectReturns the Glare Mask Object ID Integer value.N/A  
-glaregetmaterialReturns the Glare Mask Material ID Integer value.N/A  
-glarediffractionEnables/disables Glare Diffraction option.
Booleanyes 
-glareuseobstacleEnables/disables the Glare Use Obstacle image option.
Booleanyes 
-glarebladesEnables/disables the Glare Blades option.
Booleanyes 
-glarebladesrotSets the Glare Blades rotation.Floatyes 
-glarefnumberSets the Glare F-Number value.
Floatyes 
-glaresetbladesSets the Glare Blades number.Float  
-glaregetbladesReturns the Glare Blades Float value.N/A  
-glareimageSpecifies the Glare Image.String (filename)yes 
-glareobstacleimageSpecifies the Glare Obstacle image.String (filename)yes 

Stamps

FlagDescriptionArgumentsSet/GetExample
-stampEnables/disables the stamp to the VFB image.Booleanyes vray vfbControl -stamp true;
-stamphalignSets the horizontal alignment for the stamp.left | center | right

yes

 
-stampvalignSets the vertical alignment for the stamp.top | bottomyes 
-stamptextSpecifies the text String to appear on the stamp.Stringyesvray vfbControl -stamptext "Test rendering";

Environment Variables


Some aspects of the VFB can also be controlled with various environment variables:

 

Variable NameDescription

VRAY_VFB_ICONS_FILES_PATH

Load custom icons for the VFB toolbars.

VRAY_VFB_ICC_FILE

Specifies an ICC profile to use by default when ICC display color correction is enabled.

VRAY_VFB_LUT

If the value is 1, specifies whether LUT color correction should be enabled by default.

VRAY_VFB_LUT_FILE

Specifies a LUT file to use by default when LUT display color correction is enabled.

VRAY_VFB_SRGB

If the value is 1, specifies that sRGB display color correction should be enabled by default. If the value is 2, specifies that sRGB correction should be disabled by default.

VRAY_VFB_PIXEL_ASPECT

If the value is 1, specifies that the pixel aspect should be turned on by default in the VFB.

OCIO

Specifies the default OCIO color configuration if OCIO display color correction is enabled.

VRAY_VFB_OCIO

If the value is 1, specifies that OCIO display color correction should be enabled by default. If the value is 2, specifies that OCIO correction should be disabled by default.

VRAY_VFB_OCIO_INPUT_COLORSPACE

The default input OCIO color space.

VRAY_VFB_OCIO_DISPLAY_DEVICE

The default OCIO display device.

VRAY_VFB_OCIO_VIEW_TRANSFORM

The default OCIO view transform.

VRAY_VFB_AFFECT_SWATCHES

Causes the VFB display color corrections to be applied to swatches in the Material Editor. If the value is 1, only OCIO transformations are applied. If the value is 2, all VFB color corrections are applied.