I’ve been trying to render Rhino & V-Ray via Thinkbox Deadline without success.
The command sent by Deadline is as follows
"C:\Program Files\Rhino 6\System\Rhino.exe" /nosplash /runscript="_SetCurrentRenderPlugin ""V-Ray for Rhino"" -_LoadScript ""C:\share\jobs\rhino\setup.rvb"" _Render Enter -_SaveRenderWindowAs ""C:\share\jobs\rhino\deadz\deadoverride.jpg"" -_CloseRenderWindow -_Exit No " "C:\share\jobs\rhino\torus.3dm"
This tends to close the V-Ray Frame Buffer before the render finishes and closes Rhino too
If I remove the " -_CloseRenderWindow -_Exit No " section it renders the scene properly but leaves Rhino open and the console window has the save option running.
Is anyone able to help me comprehend how to run V-Ray renders via a commandline script?
There is a post on the Thinkbox Forum, but I think I’ll get more help here
V-Ray renders async to the Rhino main thread. From the Rhino’s perspective the Render command is complete, while V-Ray just finished exporting the scene and started the actual rendering.
Otherwise V-Ray will block the Rhino UI until the rendering is complete, and that will frustrate almost everyone.
Here you need to block Rhino until the rendering is done. To do this you have to have the entire command line in a script file. In your case a Visual Basic script.
Here is the revised command line:
"C:\Program Files\Rhino 6\System\Rhino.exe" /nosplash /runscript="_SetCurrentRenderPlugin ""V-Ray for Rhino"" -_LoadScript ""C:\share\jobs\rhino\setup.rvb"" -_LoadScript ""C:\share\jobs\rhino\render_vray.rvb""" "C:\share\jobs\rhino\torus.3dm"
where the render_vray.rvb file contains the blocking render call and all subsequent commands:
Set vray = Rhino.GetPlugInObject("V-Ray for Rhino")
Call vray.Render(0, 0, -1)
Call Rhino.Command("-_SaveRenderWindowAs ""C:\share\jobs\rhino\deadz\deadoverride.jpg"", True)
Call Rhino.Command("-_CloseRenderWindow", True)
Call Rhino.Command("-_Exit _No", True)
You can check the aforementioned documentation files for more options on the vray.Render() function.
In general your approach looks strange to me. I’d rather have all in one .rvb or better a .py script, and provide arguments to it for selecting rendering engines, modes, and other options. This way it is easily debugged and tested and it is much more portable and easier to maintain
Thanks ever so much Nikolay, I’ve tested this and it does work (it looks like there’s a double quote after the .jpg"")
It doesn’t save the override image or close the render box after completing though?
I’ll forward this info on to the Thinkbox devs and see if I can check the docs also.
Actually there is one less double quote there. The first one is escaping the second and the missing third is closing the string
I am currently having the same issue with Rhino + V-Ray + Deadline. I am afraid python and vb editing is beyond my depth. Every change I make breaks the process one way or another it seems. Would it be possible to see your Rhino.py file to see how it has changed?