Batch render vray from Grasshopper

Hello
I’ve had some good success in learning how to use Vray in Grasshopper. Its been really good. Now I need/want to render 2-5 scenes that take about 20 min each.

Does anyone have a good work flow to do this?

TIA

1 Like

Hi,

There is a Batch Render mode in V-Ray for Rhino, you just export your .vrscene files from GH and render them in the V-Ray Batch Render in Rhino.

Alternatively, if you don’t want to leave GH you can write your own batch renderer, by leveraging the exposed API in the V-Ray Renderer component. Mind that it is not a trivial task to do

1 Like

Thanks. The rabbit hole goes deeper.

Let me know if you need further assistance

I will take you up on your offer.

I work in lighting, with a lot of LEDS, the test setup has 7000 LED locations, and this is just the test.

For lighting, at each location, I have one emissive sphere, and two spotlights.
x=7000
x + 2x = 21000 lights.

I’ve finally put in the time to learn Vray for GH, so this has made working with the file a lot easier because I can turn off the solver while I change qtys or adjust any settings.

Because of this, I’ve basically just stopped relying on rhino except for generating some reference surfaces.

I’ve avoided baking anything into rhino, because 1. its a lot, 2. I want to go from some basic integer values from the client to either a render, or a scene I can send back to the client (architect)

I want to be able to batch render 2-5 views of the same thing.

When I import the vray scene, it imports all the breps and the lights into rhino, and each time I import a scene it imports another full set of BREPS and lights. so now for 3 scenes i have 21000 x 3 lights. Rhino does NOT like this.

Does that mean I’m going into the API? Can I get ChatGPT to do this?

Hi,

  1. I didn’t mean to import the .vrscene into Rhino. That basically defeats the purpose of your task. The V-Ray Batch Renderer can render a sequence of .vrscene files without importing anything into Rhino. In fact in this case Rhino is only involved to provide some UI and to acquire the V-Ray render lincese.

so first you bring the V-Ray BR up (V-Ray->Rendering->Batch Render)

Then use the Open button to specify paths to your .vrscene files you exported from GH for every camera (I take it you already know how to do that)

Once done, you can start the batch process by pressing the “Play” button. Mind that this will block your Rhino process for quite a while, depending on the complexity, so most people do that overnight.

You can also also have a vrscene sequence. If your files are named with a number at the end (camera01.vrscene, camera02.vrscene), the BR will search for a file name pattern “camera##.vrscene” and call that a sequence. It will enqueue the entire sequence as one entry, but the rendering will not differ from manually adding each file individually.

  1. It is also possible to render animation in GH, where each animation frame is one of your views. This is directly available in VfGH and you don’t need to batch anything, as GH will drive the animation sequence for you. Mind that not every setup is adaptable to this approach

  2. Alternatively the V-Ray Renderer component in GH exposes the Render() function, that you can use in a C# or Python scripting component in GH to drive your own batch rendering. Although this is a bit more complex and requires coding skills, it is a very powerful technique that can fit in any workflow.

So there are 3 ways to batch render number of variants of GH definitions, choose the one that best fits your needs and skillset. 1) is easy but manual, 2) is semi-automatic, but a bit more advanced, 3) is advanced and shall only be used if 2) does not work for you

I’ll try number 1 first.

Thanks for the detailed response, I appreciate it very much.

Have you ever seen this:
Screenshot 2024-09-30 100746

I dont know what this is, but the rendering is working about 50% of the time.

When I press render, its a 50/50 chance that its either going to do the batch, or it crashes.

Right now I’m testing on low rez and only medium quality, so after these tests, I’m going to bounce it up to full rez and high quality, and see how it goes.

Thanks for all your help, I really appreciate some very detailed answers and your willingness to work through teaching me this work flow.

Hi, the message is truncated, due to a bug.
It simply asks whether you want the file to be threated as part of a sequence, and whether you want the entire sequence or just a single file.
You click YES in your case.

About the failing rate - pretty disappointing, I’m sorry to hear that. Could you share some more details. Does it crash with the “Rhino and the ball” window ? If so - could you share a crash dump file (.dmp) ? Would you consider contacting Chaos support and sharing the link to this thread. The support guys will take a look and I could join as well.

Update:
I’ve added some components and it’s much more stable. The crashing has stopped.

Now, the the main issue is that I can’t get it to save the jpg, OR I can’t find it.

I’ve added the “outputimage” input to the render node, which is where I’m saving the vrscenes.

I’ve tried using the overwrite option in the batch render window.

Neither of these options has gotten me a saved file.

Here is the setup:

the BR ignores job outputs and puts all images next to the input file itself. in your case next to the vrscene. You can override the file path from the BR settings panel

I’m curious about the way you avoid the crashes. Probably I misunderstood ?! I got it as the BR in Rhino crashes during the ‘overnight’ rendering process. Now you’re talking about adding GH components… meaning the problems were not in the BR, but in GH?

I exported all the VRscenes using the output node.
I set the camera to the named cameras I set up,
and I added the node to define the output Img on the render node, which seemed to make it a lot more stable.

I never recreated the crashing. The crashing was not happening after pressing go on the batch. I have a computer on the better end of basic with an RTX GPU, so even with the load, its still crunching through the work consistently. I never had it crash half way through a render, mostly it crashed 3-5 times when I pressed go, then immediate rhino crash.

I’m just still not getting any file output, Right clicking on a render in the batch window shows that there is no file to go to.

I’m not really sure where the issue lies. When I ask Vray to render in the VFB straight from GH, by right clicking on the render node, and selecting render, the VFB starts and successfully renders, which I can save by hand out of the VFB.

My current work flow IN GH
RHINO
Set named views
|
SET SCENE:
MATERIALS
set sphere emissive (or keep at 100)
|
CAMERA EV AROUND 12-13
Set Shutter speed
Set ISO
|
Change LED INTENSITY
|
Check Following:
Render Mode (CHANGE TO PRODUCTION BEFORE EXPORT)
Quality (CHANGE TO HIGH+ BEFORE EXPORT)
Check Resolution
|
For each shot:
CAMERA
Change Named view
EXPORTER
Change Output file
Check outputfile
|
OUTPUT

OUTPUT TO VRSCENE

Rhino:
Open Batch renderer
Load all VRSCENES (different camera view)
Start

Result:
BR says finished, doesnt recognize a finished file, cant lead me to it.

Even from Rhino generated vrscene, cant get jpg out of it.

OK, so there is a crash in BR, after all.

While the BR is rendering the image, take a look at the VFB log:


You shall find something along these lines “Successfully written image file…”
This is the temporary location, where the images are saved no matter what you specify in the image output parameter. From this location the file is then moved to the place where the .vrscene file is. If the latter fails, you shall still be able to find your file in the temporary location.