Versions Compared

Key

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

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

Overview

...

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

...

typenote

Note that the commands in this page affect only the old VFB!

From MEL script

...

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

...

:

Code Block
Code Block
vfbControl
vray 
-loadimage
vfbControl 
-setregion vfbControl -setregionrel vfbControl -setregion reset vfbControl -setregionrel reset vfbControl -setregionenabled

 

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> <flag>;
vray vfbControl <flag> <argument>;

 

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

Code Block
vray vfbControl -red false;

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

With the VFB2 we have added commands to access the properties of each layer. This allows further customization and flexibility when controlling the VFB programmatically. For example - creating a white balance layer and setting its properties:

Code Block
int $dc = vray vfbControl -displayCorrectionLayer;
int $wb = vray vfbControl help -createLayer "chaos.cc.whiteBalance" $dc;
vray vfbControl -help
	-layer $wb
	-set temp 5000
	-layer $wb -set tint 0.3
	-layer $wb -set color_tint 0.9 1 0.9;

 

To open up or hide the VFB, use the following MEL see a list of available options, run one of the following commands:

Code Block
vray vfbControl;
vray vfbControl help;
vray vfbControl -help;

 

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

Code Block
vray showVFB;
vray hideVFB;

MEL Flags

...

Fancy Bullets
typecircle
  • 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"
-
linkpdp
setcompareabEnables/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.
Compare horizontal and Compare vertical features.h | hor | horizontal
v |
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 //

-
duplicate
bucketlockThe rendering buckets will start from a locked point. Use -bucketlockpoint to choose the point. This also sets -trackmouse to true.Booleanyes 
-bucketlockpointThe pixel coordinates (left, top) for the bucket starting point. To be used with -bucketlock. yes 
-duplicateDuplicates the VFB image to the
Duplicates 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

infoOpenscloses the Pixel information windowcolorbalanceBoolean-itemsociodd
FlagDescriptionArgumentsSet/GetExample
-clampEnables/disables the Force color clamping feature.Booleanyes 
-viewclampEnables/disables displaying the clamped colors in the VFB.Booleanyes 
-pixelaspectEnables/disables visualization of the pixel aspect ratio.Booleanyes 
-showhistoryocioEnables/disables the VFB History window OCIO correction.Booleanyes 
-pixelaspecticcEnables/disables visualization of the pixel aspect ratio ICC correction.Booleanyes 
-exposuresrgbEnables/disables Exposure correctiondisplaying the image in sRGB color space.Booleanyes 
-whitebalancelutin2logConverts to log space before applying LUTEnables/disables White Balance correction.Booleanyes 
-huesatEnables/disables Hue/Saturation correction.ccocioics

Sets OCIO Input Colorspace by number in the dropdown list.

IntegerBooleanyes 
-Enables/disables Color Balance correction.ccocioddSets OCIO Display Device by number in the dropdown list.Integeryes 
-levelsEnables/disables Levels correction.ccociovtSets OCIO View Transform by number in the dropdown list.IntegerBooleanyes 
-curveEnables/disables Curve correction.ocioinputcolorspaceSets OCIO Input Colorspace by name.StringBooleanyes 
-bkgrEnables/disables Background Image correction.ociodisplaydeviceSets OCIO Display Device by name.StringBooleanyes 
-lutEnables/disables LUT correction.ocioviewtransformSets OCIO View Transform by name.StringBooleanyes 
-ocioEnables/disables OCIO correction.BooleanitemsociocsReturns a list of all available OCIO Input Colorspace values.N/A yes 
-iccEnables/disables ICC correction.BooleanitemsocioddReturns a list of all available OCIO Display Device values.N/A yes 
-srgbEnables/disables displaying the image in sRGB color space.BooleanitemsociovtReturns a list of all available OCIO View Transform values.N/A yes 
-lutin2logConverts to log space before applying LUT.BooleanitemsiccriReturns a list of all available ICC Rendering Intent values.N/A yes 
-ccociovtSets OCIO View Transform by number in the dropdown list.cciccrenderintent

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

1 | 2 | 3 | 4Integeryes 
-ccocioicsloadocioSets OCIO Input Colorspace by number in the dropdown list.IntegerSpecifies file for OCIO correction.String (filename) yes 
-ccocioddSets OCIO Display Device by number in the dropdown list.IntegerloadiccSpecifies file for ICC correction.String (filename) yes 
-ocioinputcolorspaceloadpresetLoads a global preset fileSets OCIO Input Colorspace by name.String (filename)yes  
-ociodisplaydevicesavepresetSaves a global preset fileSets OCIO Display Device by name.String (filename)yes  
-iccfile
-ocioviewtransform
Sets OCIO View Transform by name.Stringyes 
-itemsociocsReturns a list of all available OCIO Input Colorspace values.N/A  
ociofileReturns the filename String used in the corresponding Correction Control rollout.N/A  

Layer Access

FlagDescriptionArgumentsSet/GetExample

-listLayers

Returns a list of all
available OCIO Display Device values.N/A
the created layers.  

vray vfbControl -

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 - Highlights0 | 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 modeBoolean
0 | 1 | 2
red | cyan | green | magentayesvray vfbControl -stereo 2; vray vfbControl -stereo cyan;
-cclevels_rgb
-cclevels_red
-cclevels_green
-cclevels_blueEnables/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  -setlutweightSets the LUT Weight 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  -getlutweightReturns the LUT weight 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)  -saveccpreset

listLayers;

-layer <ID> -name

Returns the name of/Renames the layer with the selected ID.Stringyes

vray vfbControl -layer 1 -name; //Gets the name of the layer with ID 1
vray vfbControl -layer 1 -name "DC"; //Renames the layer with ID 1 to DC

-layer <ID> -class

Displays the class of the layer with the selected ID.  

vray vfbControl -layer 1 -class; //Prints the class of the layer with ID 1

-layer <ID> -isEnabled

Displays whether or not a layer with the selected ID is enabled.  

vray vfbControl -layer 1 -isEnabled; //Prints whether the layer with ID 1 is enabled

-layer <ID> -en

Enables or disables a layer. The argument can be omitted and defaults can be enabled.

Boolean 

vray vfbControl -layer 1 -enable 0; //Disables the layer with ID 1

vray vfbControl -layer 1 -enable 1; //Enables the layer with ID 1

-layer <ID> -listProperties

Returns a list of the property names of the layer with the selected ID.  vray vfbControl -layer 1 -listProperties; //Lists all the properties of the layer with ID 1

-layer <ID> -propertyType

Returns a list of the property types of the layer with the selected ID.String vray vfbControl -layer 1 -propertyType "exposure"; //Gets the ID type of the property "exposure" for the Display Correction layer with ID 1 *

-layer <ID> -propertyValues

Returns the list of strings accepted as values for an Enum property.String vray vfbControl -layer 1 -propertyValues "profile"; //Gets a list of possible values for Enum properties of the Display Correction layer with ID 1 *

-layer <ID> -g

Displays the value of a chosen property.String vray vfbControl -layer 1 -get "exposure"; //Gets the value of the Exposure parameter of the Display Correction layer with ID 1 *

-layer <ID> -s

Specifies the value of a chosen property.String vray vfbControl -layer 1 -set "exposure" 0.05; //Sets the value of the Exposure parameter of the Display Correction layer to 0.05 *

-layer <ID> -parent

Returns the ID of the layer's parent.  vray vfbControl -layer 1 -parent; //Gets the layer IDs of the parent layers of the Display Correction Layer with ID 1 *

-layer<ID> -listChildren

Returns a list of the children of the layer with the selected ID.  vray vfbControl -layer 1 -listChildren; //Gets a list with the layer IDs of all the child layers of the Display Correction Layer with ID 1 *

-layer <ID> -delete

Deletes the layer with the selected ID.  vray vfbControl -layer 9 -delete; //Deletes the layer with ID 9.
-createlayer <class name> <parent id>

Creates a layer of the given class as a child of the given layer, returns the new layer's ID. The new layer is created as the topmost child of the parent layer.

  vray vfbControl -createLayer "chaos.cc.exposure" 1; //Creates an exposure layer under the Display Correction group *

-listLayerClasses

Returns a list of creatable layer classes.

  vray vfbControl -listLayerClasses;

-findLayerByName

Returns the ID of a layer with the given name or -1 if no such layer is found.

String vray vfbControl -findLayerByName "Display Correction"; //Gets the ID of the Display Correction layer.

-findLayersByClass

Returns a list of the IDs of all layers of the given class.

String 

vray vfbControl -findLayersByClass "chaos.displayCorrection";

//Gets the ID of the layer from the chaos.displayCorrection class

-displayCorrectionLayer

Returns the ID of the display correction layer.

  vray vfbControl -displayCorrectionLayer;

-sourceLayer

Returns the ID of the source layer.

  vray vfbControl -sourceLayer; //Returns the ID of the source layer

-denoiserLayer

Returns the ID of the denoiser layer.

  vray vfbControl -denoiserLayer; //Returns the ID of the denoiser layer

-lensEffectsLayer

Returns the ID of the lens effects layer.

  vray vfbControl -lensEffectsLayer; //Returns the ID of the Lens Effects layer

-lightMixLayer

Returns the ID of the light mix layer.

  vray vfbControl -lightMixLayer; //Returns the ID of the Light Mix layer

-saveLayersToJSON

Returns a JSON string representing the state of all layers.

  vray vfbControl -saveLayersToJSON; //Returns a JSON string representing the state of all layers

-loadLayersFromJSON

Loads settings from a JSON string.

String vray vfbControl -loadLayersFromJSON "\insert here the JSON string that represents the state of all layers from the -saveLayersToJSON argument;

-saveLayersToFile

Saves layers to a file

Saves the settings for a specific color correction rollout

.

String (filename) 
 -resetcc
-resetccexp
-resetccwb
-resetcchsl
-resetccbal
-resetcclvl
-resetcccrv
-resetcclut
-resetccicc
-resetccocio
-resetccbgimgResets parameters from corresponding Correction Control rollouts to default values.
vray vfbControl -saveLayersToFile "C:\Path\To\Location\layers.txt"; //Saves a text file representing the state of all layers

-loadLayersFromFile

Loads layers from a file.

String (filename) 

vray vfbControl -loadLayersFromFile "C:\Path\To\Location\layers.txt";

//Loads the layers with all the states represented in the file

-bakeLayersToLUT

Bakes all layers to a LUT file.

String (filename)
N/A
 

vray vfbControl -

resetcc

bakeLayersToLUT "C:\Path\To\Location\layers.lut";

//

Resets all correction control parameters

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

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

Bakes all layers to a lut file

Anchor
NOTE
NOTE

NOTE: The ID of the Display Correction layer is different for each session. The given examples will not work, if the Display Correction layer's ID is not the same as in the examples.

 

VFB History

FlagDescriptionArgumentsSet/GetExample
-showhistoryEnables/disables the VFB History window.Booleanyes 
-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 

...

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 

...

FlagDescriptionArgumentsSet/GetExample
-stampEnables/disables the stamp to the VFB image.Booleanyes vray  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:

...