# IRiVray Interface Reference

Inherits IDispatch.

List of all members.

## Public Member Functions
HRESULT | RenderTsScene ()
HRESULT | RenderRScene (VARIANT bsViewName, VARIANT iObjectOnly)
HRESULT | OpenVrayPanel ()
HRESULT | OpenVrayView (VARIANT bsViewName, VARIANT iWidth, VARIANT iHeight)
HRESULT | SaveToFile (VARIANT bsSaveFile)
HRESULT | RenderRSceneArea (VARIANT bsViewName, VARIANT iLeft, VARIANT iTop, VARIANT iRight, VARIANT iBottom)
HRESULT | RenderRSceneAnim (VARIANT bsViewName, VARIANT iObjectOnly)
HRESULT | CycleMaterialEditorPreviewGeometry ()
HRESULT | ResetMaterialEditorShader (VARIANT bsShaderName)

## Detailed Description

The IRiVray interface provides methods to access Vray rendering, settings panel, Vray View and some Vray Material Editor.
Root-level name in the scripting engine's name space: Vray

## Member Function Documentation

HRESULT IRiVray::RenderTsScene | ( |  | ) |

Renders scene currently seen in modeler.

Example:

        Vray.RenderTsScene();

Returns:
  standard HRESULT processing can be applied to returned value

HRESULT IRiVray::RenderRScene | ( | VARIANT | bsViewName,
|  | VARIANT | iObjectOnly |
| ) |  |  |

Renders scene currently seen in workspace.

Parameters:

  | bsViewName | [in] Name of view displayed in window title bar. Can be blank.
  | iObjectOnly | [in] Specifies if only selected object will be rendered. Specify 0 for rendering whole scene, 1 for selected object.

Returns:
  standard HRESULT processing can be applied to returned value.

Example:

        Vray.RenderRScene('Vray render view', 0);

HRESULT IRiVray::OpenVrayPanel | ( |  | ) |

Opens Vray settings panel.

Returns:
  standard HRESULT processing can be applied to returned value.

Example:

        Vray.OpenVRayPanel();

HRESULT IRiVray::OpenVrayView | ( | VARIANT | bsViewName,
|  | VARIANT | iWidth,
|  | VARIANT | iHeight |
| ) |  |  |

Opens Vray view.

Parameters:

  | bsViewName | [in] Name of view displayed in window title bar. Can be blank.
  | iWidth | [in] Width of view in pixels (if 0, default width is used).
  | iHidth | [in] Height of view in pixels (if 0, default height is used).

Returns:
  standard HRESULT processing can be applied to returned value.

Example:

        Vray.OpenVrayView('Vray view', 800, 600);

HRESULT IRiVray::SaveToFile | ( | VARIANT | bsSaveFile | ) |

Saves currently rendererd scene into specified file.

- Be sure to call PhotoMaterialEditor.RegisterVRayPackage() before calling this.

Parameters:

  | bsSaveFile | [in] File name to which scene is to be written. If blank, system will invoke file dialog to specify the name.

Returns:
  standard HRESULT processing can be applied to returned value.

Example:

        Vray.SaveToFile('C:\\Vray renders\\render.bmp');

Note : backslashes must be escaped (i.e. use double backslash wherever one occurs)

HRESULT IRiVray::RenderRSceneArea | ( | VARIANT | bsViewName,
|  | VARIANT | iLeft,
|  | VARIANT | iTop,
|  | VARIANT | iRight,
|  | VARIANT | iBottom |
| ) |  |  |

Renders specified area of workspace scene.

- Be sure to call PhotoMaterialEditor.RegisterVRayPackage() before calling this.

Parameters:

  | bsViewName | [in] Name of view displayed in window title bar.
  | iLeft | [in] Left edge of rendered area.
  | iTop | [in] Top edge of rendered area.
  | iRight | [in] Right edge of rendered area.
  | iBottom | [in] Bottom edge of rendered area.

Returns:
  standard HRESULT processing can be applied to returned value.

Example: Renders rectangle beginning at (100,100) which is 400 pixels wide and 200 pixels high.

        PhotoMaterialEditor.RegisterVRayPackage();
        Vray.RenderRSceneArea('Vray view', 100, 100, 500, 300);

HRESULT IRiVray::RenderRSceneAnim | ( | VARIANT | bsViewName,
|  | VARIANT | iObjectOnly |
| ) |  |  |

Renders animated sequence of workspace scene.

- Be sure to call PhotoMaterialEditor.RegisterVRayPackage() before calling this.

Parameters:

  | bsViewName | [in] Name of view displayed in window title bar.
  | iObjectOnly | [in] Specifies if only selected object will be rendered. Specify 0 for rendering whole scene, 1 for selected object.

Returns:
  standard HRESULT processing can be applied to returned value.

Example:

        Vray.OpenVrayView('Vray view', 1);

HRESULT IRiVray::CycleMaterialEditorPreviewGeometry | ( |  | ) |

Cycle through vray material editor color preview shape type.

Returns:
  standard HRESULT processing can be applied to returned value

Example:

     Vray.CycleMaterialEditorPreviewGeometry();

HRESULT IRiVray::ResetMaterialEditorShader | ( | VARIANT | bsShaderName | ) |

Reset specified material editor shader.

Parameters:

  | bsShaderName | [in] Shader name to reset. Can be Color, Displacement, Transparency or Reflectance.

Returns:
  standard HRESULT processing can be applied to returned value.

Example:

     Vray.ResetMaterialEditorShader('Color');