VRay SDK for C#
|
Wrapper for a given VRayRenderer's VFB functions More...
Classes | |
class | Layer |
class | VFBLayerManager |
This class groups all VFB layers related methods. 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). More... | |
Public Member Functions | |
bool | ApplySettingsVFB () |
Fill in the lens effects settings from the SettingsVFB plugin into the VFB GUI. Nothing is changed if the plugin does not exist in the scene or its 'cc_settings' param is empty. More... | |
void | ClearImage () |
Clears the current image buffer | |
void | EnableProgressBar (bool enable=true) |
Enables the progress bar in the VFB window. More... | |
bool | FillSettingsVFB (string instanceName=null) |
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. More... | |
string | GetLayers () |
Get VFB2 layers as JSON. More... | |
bool | GetMinimumSize (out int width, out int height) |
Query the minimum size required by the VFB layout More... | |
IntPtr | GetNativeHandle () |
Returns the VFB as a native UI handle. More... | |
byte[] | GetPersistentState () |
Gets the V-Ray VFB Persistent state. More... | |
bool | GetPositionAndSize (out int x, out int y, out int w, out int h) |
Gets the V-Ray VFB window position and size. More... | |
IntPtr | GetQWidget () |
Returns the VFB as a QWidget* | |
string | GetSettings () |
Get VFB2 settings as JSON. More... | |
byte[] | GetState (bool includeMain=true, bool includeHistory=true) |
Gets the V-Ray VFB state. More... | |
IntPtr | GetWindowHandle () |
Returns the window handle associated with the current V-Ray VFB. It's actually HWND on Windows. WARNING: Use this method with extreme caution or better do not use it at all! Always use higher level methods when available. More... | |
bool | LoadColorCorrectionsPreset (string filename) |
Loads the global state of the color correction controls More... | |
bool | LoadImage (string fileName) |
Load an image from disk into the framebuffer. All image channels are loaded. More... | |
void | LogMessage (LogLevelType level, string message) |
Logs a message to the VFB log (if it's enabled). More... | |
void | ResetState () |
Resets the V-Ray VFB as if it was just created. More... | |
bool | SaveColorCorrectionsPreset (string filename) |
Saves the global state of the color correction controls More... | |
bool | SaveImage (String fileName, ImageWriterOptions options=null) |
Saves the current image from renderer to file. This allows you to save as some formats (TIFF, EXR) not supported by the VRayImage class. ImageWriterOptions allows more control especially for EXRs. More... | |
bool | SetLayers (string json) |
Set VFB2 layers. More... | |
void | SetNativeParentWindow (IntPtr handle) |
Sets the native parent of the current V-Ray VFB window. More... | |
void | SetParentWindow (IntPtr hWnd) |
Sets the parent of the current V-Ray VFB window. WARNING: Use this method with extreme caution or better do not use it at all! Always use higher level methods when available. More... | |
void | SetPersistentState (byte[] state) |
Sets the V-Ray VFB Persistent state. More... | |
void | SetPosition (int x, int y) |
Sets the V-Ray VFB window position. More... | |
void | SetPositionAndSize (int x, int y, int w, int h) |
Sets the V-Ray VFB window position and size. More... | |
void | SetProgressText (string text) |
Sets a text string to the VFB progress bar. The text is only shown if the progress bar window is enabled. More... | |
void | SetProgressTextAndValue (string text, float value) |
Sets a progress text and value to the VFB progress bar The text is only shown if the progress bar window is enabled More... | |
void | SetProgressValue (float value=-1.0f) |
Sets a progress bar value to the VFB progress bar. The text is only shown if the progress bar window is enabled More... | |
bool | SetProjectPath (string projectPath) |
Set the directory that will be used if "Use project path" is enabled in the History settings More... | |
void | SetQWidgetParent (IntPtr parentWidget) |
Sets the QWidget parent of the current V-Ray VFB window. More... | |
bool | SetSettings (string json) |
Set VFB2 settings. More... | |
void | SetState (byte[] state, bool setMain=true, bool setHistory=true) |
Sets the V-Ray VFB state. More... | |
bool | SetTitlePrefix (string prefix) |
Sets a prefix for the VFB window title More... | |
void | SetUpdateAvailable (bool available) |
Sets a notification for available update in the VFB. More... | |
Static Public Member Functions | |
static void | Enable (bool isEnabled) |
Globally enables/disables the V-Ray frame buffer. The method must be called before instantiating any VRayRenderer instances. Once the frame buffer has been disabled the CLR needs to be restarted in order to enable the buffer again. By default the frame buffer is enabled but can be hidden with the showFrameBuffer option set to false for the RendererOptions. More... | |
static void | SetGUIMessageProcessing (bool enableMessageProcessing) |
Call this before operating with a renderer to enable or disable GUI message processing during internal waits. Note that the message processing is enabled by default. More... | |
static void | SetUseParentEventLoop () |
Call this before creating a renderer for the first time if you are going to parent it to your Win32 window. WARNING: You will get a deadlock if you call setUseParentEventLoop and you don't execute vfb.setParentWindow before showing the VFB | |
Properties | |
bool | AlwaysOnTop [set] |
Sets/resets always on top. | |
bool | ClearImageConfirmation [get, set] |
Confirmation dialog when clearing the image buffer through the VFB "Clear Image". | |
bool | Interactivity [get, set] |
Moving and rotating the scene with the mouse in V-Ray VFB. | |
VFBLayerManager | LayerManager [get] |
The layer manager. | |
VRayRenderer | Renderer [get] |
The renderer to which this VFB belongs. | |
bool | Shown [get, set] |
Show/hide frame buffer. | |
Wrapper for a given VRayRenderer's VFB functions
bool VRay.VFB.ApplySettingsVFB | ( | ) |
Fill in the lens effects settings from the SettingsVFB plugin into the VFB GUI. Nothing is changed if the plugin does not exist in the scene or its 'cc_settings' param is empty.
|
static |
Globally enables/disables the V-Ray frame buffer. The method must be called before instantiating any VRayRenderer instances. Once the frame buffer has been disabled the CLR needs to be restarted in order to enable the buffer again. By default the frame buffer is enabled but can be hidden with the showFrameBuffer option set to false for the RendererOptions.
isEnabled | True if the frame buffer should be enabled. |
void VRay.VFB.EnableProgressBar | ( | bool | enable = true | ) |
Enables the progress bar in the VFB window.
enable | Enable. Default is true. |
bool VRay.VFB.FillSettingsVFB | ( | string | instanceName = null | ) |
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 |
string VRay.VFB.GetLayers | ( | ) |
Get VFB2 layers as JSON.
bool VRay.VFB.GetMinimumSize | ( | out int | width, |
out int | height | ||
) |
Query the minimum size required by the VFB layout
width | [output] - the minimum width. |
height | [output] - the minimum height. |
IntPtr VRay.VFB.GetNativeHandle | ( | ) |
Returns the VFB as a native UI handle.
The reason to return an NSView on MacOS is because it is trivial to retrieve the NSWindow owning a given NSView, while doing the opposite is more complicated especially if the VFB is docked within a parent window owning multiple views.
byte[] VRay.VFB.GetPersistentState | ( | ) |
bool VRay.VFB.GetPositionAndSize | ( | out int | x, |
out int | y, | ||
out int | w, | ||
out int | h | ||
) |
Gets the V-Ray VFB window position and size.
x | The x position in screen coordinates. |
y | The y position in screen coordinates. |
w | The width. |
h | The height. |
string VRay.VFB.GetSettings | ( | ) |
Get VFB2 settings as JSON.
byte[] VRay.VFB.GetState | ( | bool | includeMain = true , |
bool | includeHistory = true |
||
) |
IntPtr VRay.VFB.GetWindowHandle | ( | ) |
bool VRay.VFB.LoadColorCorrectionsPreset | ( | string | filename | ) |
Loads the global state of the color correction controls
filename | Path to the preset to be loaded including the ".vccglb" extension |
bool VRay.VFB.LoadImage | ( | string | fileName | ) |
Load an image from disk into the framebuffer. All image channels are loaded.
fileName | Path to the image file |
void VRay.VFB.LogMessage | ( | LogLevelType | level, |
string | message | ||
) |
Logs a message to the VFB log (if it's enabled).
level | The log level. |
message | The log message. |
void VRay.VFB.ResetState | ( | ) |
Resets the V-Ray VFB as if it was just created.
This will not clear the image, use ClearImage() for that.
bool VRay.VFB.SaveColorCorrectionsPreset | ( | string | filename | ) |
Saves the global state of the color correction controls
filename | Path to the preset to be saved. Automatically appends ".vccglb" extension |
bool VRay.VFB.SaveImage | ( | String | fileName, |
ImageWriterOptions | options = null |
||
) |
Saves the current image from renderer to file. This allows you to save as some formats (TIFF, EXR) not supported by the VRayImage class. ImageWriterOptions allows more control especially for EXRs.
fileName | |
options |
|
static |
Call this before operating with a renderer to enable or disable GUI message processing during internal waits. Note that the message processing is enabled by default.
enableMessageProcessing | True to enable and false to disable the GUI message processing. |
bool VRay.VFB.SetLayers | ( | string | json | ) |
Set VFB2 layers.
json | JSON layers info. |
void VRay.VFB.SetNativeParentWindow | ( | IntPtr | handle | ) |
Sets the native parent of the current V-Ray VFB window.
handle | The parent handle. HWND on Windows, NSWindow on MacOS. |
When the VFB is meant to be parented but undocked, the passed handle should be the VFB window owner. In this case, the VFB will be a free floating window while enforcing windows ordering and preventing it to fall behind its owner. When the VFB is docked, the passed handle will be the vfb parent window where is embedded the VFB as a widget.
void VRay.VFB.SetParentWindow | ( | IntPtr | hWnd | ) |
Sets the parent of the current V-Ray VFB window. WARNING: Use this method with extreme caution or better do not use it at all! Always use higher level methods when available.
hWnd | The parent window handle. It's actually HWND on Windows. |
void VRay.VFB.SetPersistentState | ( | byte[] | state | ) |
Sets the V-Ray VFB Persistent state.
state | A byte array containing the VFB Persistent state binary data as previously returned by GetPersistentState() |
void VRay.VFB.SetPosition | ( | int | x, |
int | y | ||
) |
Sets the V-Ray VFB window position.
x | The x position in screen coordinates. |
y | The y position in screen coordinates. |
void VRay.VFB.SetPositionAndSize | ( | int | x, |
int | y, | ||
int | w, | ||
int | h | ||
) |
Sets the V-Ray VFB window position and size.
x | The x position in screen coordinates. |
y | The y position in screen coordinates. |
w | The width. |
h | The height. |
void VRay.VFB.SetProgressText | ( | string | 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. |
void VRay.VFB.SetProgressTextAndValue | ( | string | text, |
float | 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. |
void VRay.VFB.SetProgressValue | ( | float | value = -1.0f | ) |
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. |
bool VRay.VFB.SetProjectPath | ( | string | projectPath | ) |
Set the directory that will be used if "Use project path" is enabled in the History settings
projectPath | The path |
void VRay.VFB.SetQWidgetParent | ( | IntPtr | parentWidget | ) |
Sets the QWidget parent of the current V-Ray VFB window.
parentWidget | The QWidget* instance to use as parent. |
bool VRay.VFB.SetSettings | ( | string | json | ) |
Set VFB2 settings.
json | JSON settings string |
void VRay.VFB.SetState | ( | byte[] | state, |
bool | setMain = true , |
||
bool | setHistory = true |
||
) |
Sets the V-Ray VFB state.
state | A byte array containing the VFB state binary data as previously returned by GetState() |
setMain | Whether to set the main VFB state data - window state, buttons, etc. |
setHistory | Whether to set the history settings. |
Setting a missing part of the data will be silently skipped (i.e. 'state' has only history state, but setMain=true)
bool VRay.VFB.SetTitlePrefix | ( | string | prefix | ) |
Sets a prefix for the VFB window title
prefix | Prefix |
void VRay.VFB.SetUpdateAvailable | ( | bool | available | ) |
Sets a notification for available update in the VFB.
available | true if an update is available, false otherwise. |