Rhino python has no time to redraw

Hello,

I´m using the following python script to render 8 views in R7.

batchrender_Python.py (1.1 KB)

I can render each view individually at “res = 10” (producing some 10k x 10k pixels) and all are smooth, but when I use the script as intended for batch rendering it seems to not have enough time to render the shadows before capturing the view, but only in some of the rendered views. Note that the texture size, object size and render resolution on “res = 10” are all necessary.


worst


bad (edge)


good

I tried various sleep, redraw etc methods but nothing worked (sleep methods probably because they put rhino on hold instead of letting it draw the shadows and redraw probably because I don´t know what I´m doing).

I think I just need to let Rhino cool before line 28 but all my attempts failed. Any idea how I could do that? Thank you. :slight_smile:

example.3dm (8.6 MB)

If you add the following line after the rs.Command() which calls the view capture:

rh.RhinoApp.Wait()

Does it help? You might need to add it in a couple of places, like also after the RestoreNamedVew call… IDK.

Strangely enough, this made the problem worse, haha :smiley: