vray.VFB

class vray.VFB

Bases: object

A namespace-like class for VFB related methods. It’s associated with one specific VRayRenderer instance and does not affect any other instances.

Attributes

alwaysOnTop

Set the always-on-top state of the V-Ray VFB.

confirmClearImage

Gets/sets whether a confirmation dialog is shown when clearing the image buffer through the VFB “Clear image” button.

historyManager

Returns a VFBHistoryManager wrapper object with methods related to VFB History manipulations.

interactivity

Gets/sets whether moving and rotating the scene with the mouse in V-Ray VFB is enabled.

layerManager

Returns a VFBLayerManager wrapper object with methods related to VFB layer management.

position

Get/set the V-Ray VFB window position in screen coordinates.

shown

Show/hide V-Ray frame buffer.

size

Get/set the V-Ray VFB window size in pixels.

toolbarManager

Returns a VFBToolbarManager wrapper object with methods related to VFB Toolbar manipulations.

Methods

__init__()

applySettingsVFB(self)

Fill in the lens effects settings from the SettingsVFB plugin into the VFB GUI.

clearImage(self)

Clears the current image buffer.

enableProgressBar(self, enable)

Enables the progress bar in the VFB window.

fillSettingsVFB(self, instanceName)

Fill in the lens effects settings from the VFB GUI into the SettingsVFB plugin.

getLayers(self)

Get VFB2 layers as JSON string.

getPersistentState(self)

Get an opaque serialized buffer with the V-Ray VFB Persistent state.

getSettings(self)

Get VFB2 settings as JSON string.

getState(self, parts)

Get an opaque serialized buffer with the V-Ray VFB state.

loadColorCorrectionsPreset(self, filename)

Loads the global state of the color correction controls.

loadImage(self, filename)

Load an image from disk into the framebuffer.

logMessage(self, level, message)

Logs a message to the VFB log if it is enabled.

resetState(self)

Reset the V-Ray VFB state as if it was just created.

saveColorCorrectionsPreset(self, filename)

Saves the global state of the color correction controls.

saveImage(self, filename, options)

Saves the current image directly to file.

setLayers(self, layers)

Set VFB2 layers as JSON string.

setPersistentState(self, state)

Set the V-Ray VFB Persistent state with data returned from getPersistentState (possibly from a previous session).

setProgressText(self, text)

Sets a text string to the VFB progress bar. The text is only shown if the progress bar window is enabled. text - Text string to set.

setProgressTextAndValue(self, text, value)

Sets a progress text and value to the VFB progress bar The text is only shown if the progress bar window is enabled. text - Text string to set. value - Value to be set in the range of 0..1.

setProgressValue(self, value)

Sets a progress bar value to the VFB progress bar The text is only shown if the progress bar window is enabled. value - Value to be set in the range of 0..1.

setProjectPath(self, path)

Set the directory that will be used if “Use project path” is enabled in the History settings.

setSettings(self, settings)

Set VFB2 settings as JSON string.

setState(self, state, parts)

Set the V-Ray VFB state with data returned from getState (possibly from a previous session).

setTitlePrefix(self, prefix)

Sets a prefix string for the VFB window title.

applySettingsVFB(self) → bool

Fill in the lens effects settings from the SettingsVFB plugin into the VFB GUI. If the plugin does not exist in the scene or its ‘cc_settings’ parameter is empty, nothing is changed.

Returns boolean for success or failure (True: settings were applied, False: nothing was changed)

clearImage(self) → None

Clears the current image buffer.

enableProgressBar(self, enable: bool | None = None) → None

Enables the progress bar in the VFB window. enable - Enable. Default is true.

fillSettingsVFB(self, instanceName: str) → bool

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.

  • instanceName - The name of the new instance if one has to be created. If not set a default autogenerated name is used.

Returns boolean for success or failure

getLayers(self) → bytes

Get VFB2 layers as JSON string.

getPersistentState(self) → memoryview

Get an opaque serialized buffer with the V-Ray VFB Persistent state.

getSettings(self) → bytes

Get VFB2 settings as JSON string.

getState(self, parts: int | None = None) → memoryview

Get an opaque serialized buffer with the V-Ray VFB state.

loadColorCorrectionsPreset(self, filename: str) → bool

Loads the global state of the color correction controls.

  • filename - Path to the preset to be loaded including the ‘.vccglb’ extension.

Returns boolean for success or failure

loadImage(self, filename: str) → bool

Load an image from disk into the framebuffer. All image channels are loaded.

  • filename - Path to the image file.

Returns boolean for success or failure

logMessage(self, level: int, message: str) → None

Logs a message to the VFB log if it is enabled. * level - the level of the message (one of the vray.LOGLEVEL_* constants) * message - the text to be logged

resetState(self) → None

Reset the V-Ray VFB state as if it was just created.

saveColorCorrectionsPreset(self, filename: str) → bool

Saves the global state of the color correction controls.

  • filename - Path to the preset to be saved. Automatically appends ‘.vccglb’ extension.

Returns boolean for success or failure

saveImage(self, filename: str, options: dict) → bool

Saves the current image directly to file.

This call is equivalent to using the VFB save button and supports the same formats.

  • filename, string - target file name. The extension determines the format.

  • options, dict - save options, see below. Can be omitted entirely or partially

Options dict:

  • skipAlpha, bool - do not write the alpha channel into a separate file

  • frameNumber, bool - the current frame number will be appended to the file name(s)

  • noAlpha, bool - do not write the alpha channel together with the color data

  • singleChannel, bool - only a single channel is written to the file (the current one in vfb)

  • skipRGB, bool - do not write the RGB channel into a separate file

  • writeIntegerIDs, bool - (EXR only) write to EXR as integer data

  • multiChannel, bool - create a single multi-channel file if the file format supports it

  • applyColorCorrections, bool - bake the VFB color corrections to the output file

  • compressionType, string - (EXR only) one of ‘noCompression’, ‘runLength’, ‘zipScanline’, ‘zipBlock’, ‘piz’, ‘pxr24’, ‘b44’, ‘b44a’, ‘dwaa’, ‘dwab’

  • bitsPerChannel, int - (EXR only) either 16 or 32

Returns True on success.

setLayers(self, layers: bytes) → bool

Set VFB2 layers as JSON string.

setPersistentState(self, state: memoryview) → None

Set the V-Ray VFB Persistent state with data returned from getPersistentState (possibly from a previous session).

setProgressText(self, text: str) → None

Sets a text string to the VFB progress bar. The text is only shown if the progress bar window is enabled.

text - Text string to set.

setProgressTextAndValue(self, text: str, value: float) → None

Sets a progress text and value to the VFB progress bar The text is only shown if the progress bar window is enabled.

text - Text string to set. value - Value to be set in the range of 0..1.

setProgressValue(self, value: float | None = None) → None

Sets a progress bar value to the VFB progress bar The text is only shown if the progress bar window is enabled.

value - Value to be set in the range of 0..1.

setProjectPath(self, path: str) → bool

Set the directory that will be used if “Use project path” is enabled in the History settings.

Returns boolean for success or failure

setSettings(self, settings: bytes) → bool

Set VFB2 settings as JSON string.

setState(self, state: memoryview, parts: int | None = None) → None

Set the V-Ray VFB state with data returned from getState (possibly from a previous session).

setTitlePrefix(self, prefix: str) → bool

Sets a prefix string for the VFB window title.

Returns boolean for success or failure

alwaysOnTop

Set the always-on-top state of the V-Ray VFB. No getter available.

confirmClearImage

Gets/sets whether a confirmation dialog is shown when clearing the image buffer through the VFB “Clear image” button.

historyManager

Returns a VFBHistoryManager wrapper object with methods related to VFB History manipulations.

interactivity

Gets/sets whether moving and rotating the scene with the mouse in V-Ray VFB is enabled.

layerManager

Returns a VFBLayerManager wrapper object with methods related to VFB layer management.

position

Get/set the V-Ray VFB window position in screen coordinates.

shown

Show/hide V-Ray frame buffer.

size

Get/set the V-Ray VFB window size in pixels.

toolbarManager

Returns a VFBToolbarManager wrapper object with methods related to VFB Toolbar manipulations.