Problem rendering images running rhinoscript from command line

Hello,

I have a script in rhinoscript (.rvb) that, among other things, make a few image captures. Before I make this captures I choose differrent Render options and Views. The problem is that when I execute this script with my Rhino opened (Tools–> Rhinoscript–>Load) the images created are OK, but if I run it from command line (via ssh) images are not well rendered.

This is how I run my script form the command line via ssh:

"C:\Program Files\Rhinoceros 5 (64-bit)\System\Rhino.exe" /nosplash /runscript="-_LoadScript myscript.rvb <inputFile.stl> <outputPahtForImages>"

I attach an image showing differences between the captured images created by my script in both ways. The first one is the image I want (and it is generated when I run my script with Rhino opened), and the second one is the one generated when I run my script from command line via ssh. When I use the command line option I see a Rhino process in the task manager but in background (I don’t see Rhino opened and my script running in the screen). Maybe the problem is that Rhino does not load Render options when running in background?

Here is the part in my code that selects the view and the render option:

Rhino.CurrentView "Frontal"

Rhino.ZoomExtents , True

Rhino.ViewDisplayModeEx "Frontal", "Rendered"

Rhino.command("_-ViewCaptureToFile " & outputImageFile2 & " W=565 H=219 S=1 D=_No R=_No A=_No T=_No _enter")

Any help please?

Thank you in advance.

Kind regards,

Enrique.

1 Like

Hi Enrique,

Since the view is never displayed, you might not be able to do a “view capture.” You might consider just rendering the view instead.

Here are two scripts that batch render (from within Rhino and outside of Rhino). They might give you a few ideas.

https://github.com/mcneel/rhinoscript/blob/master/BatchRender.rvb

https://github.com/mcneel/rhinoscript/blob/master/BatchRender.vbs

1 Like

Thank you Dale!

I have my rendered images now! I am facing an issue with the Ghosted one, but maybe I cannot use this render type with batch render. Is it possible?

Thanks again.

Hello Enrique,

Thanks for the great topic. I had a question for you. In the command line to give both a <inputFile.stl> and . How do you read those in the myscript.rvb? I apologize if this is an obvious question.

Thanks,

Ariel

I realize now that the inputFile.stl & outputPahtForImages are variables that runscript is looking for.

Thanks,

Ariel