Versions Compared

Key

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

Rendering and exporting proxy meshes, scenes, and animation can be done through Grasshopper's C# Script and/or GHPython Script components. 

Overview


Rendering and exporting proxy meshes and scenes (including animation) can be done through Grasshopper's C# Script and/or GHPython Script components. The methods are listed in the table below.

 

public bool RenderAnimation();

Starts animation renderer.

public bool Render(bool sync = false); 

 

Starts renderer.

 true = function executed synchronously

 false = function executed asynchronously

public string ExportProxy(string filePath, bool animated = false);

 

Exports .vrmesh file (@" .vrmesh")

true = export as animated proxy

false = export as static proxy

public string ExportScene(string filePath, bool animated = false);

 

Exports .vrscene file (@" .vrscene")

true = export as animated proxy;

false = export as static proxy

public string ExportSequence(string filePath);Exports an animation sequence of V-Ray Scene (.vrscene) files (@" .vrscene")

 

C# Script 


 

1. Create a C# Script component and plug the renderer output in one of its inputs.

 

  

 

2. Add references to VRaySDK.Net.dll and VRayForGrasshopper.gha

 

 

3. In the code editor, cast the input variable to VRayForGrasshopper.Scripting.VRayRenderer.

Code Block
languagecpp
VRayForGrasshopper.Scripting.VRayRenderer renderer = x as VRayForGrasshopper.Scripting.VRayRenderer; renderer.Render(false);
Code Block
languagec#
VRayForGrasshopper.Scripting.VRayRenderer renderer = x as VRayForGrasshopper.Scripting.VRayRenderer; renderer.ExportProxy(@"filePath\fileName.vrmesh");
Code Block
languagec#
VRayForGrasshopper.Scripting.VRayRenderer renderer = x as VRayForGrasshopper.Scripting.VRayRenderer; renderer.ExportScene(@"filePath\fileName.vrscene");

 

GhPython Script 


 

1. Create a GhPython Script component and plug the renderer output in one of its inputs.

 

 

2. In the code editor, call any of the above methods on the input variable.