On 03/11/2014 at 17:20, xxxxxxxx wrote:
c4d.CallCommand(12099) # Render to Picture Viewer
I would like to re-create the command above. However, this
doc = documents.GetActiveDocument ()
rd = doc.GetActiveRenderData ()
rdata = rd.GetData ()
xres = int ( rdata[ c4d.RDATA_XRES ] )
yres = int ( rdata[ c4d.RDATA_YRES ] )
bmp = bitmaps.BaseBitmap ()
bmp.Init ( x = xres, y = yres )
res = c4d.documents.RenderDocument( doc, rdata, bmp, renderflags = c4d.RENDERFLAGS_EXTERNAL, th = None )
if res == c4d.RENDERRESULT_OK:
bitmaps.ShowBitmap ( bmp )
will lock up Cinema until the render finishes. I have tried the other options with the render flags, and can't seem to get more than a frame to render ( or save for that matter ). I have noticed with the c4d.RENDERFLAGS_EXTERNAL flag, it will render out the sequence, but it will look strange in the picture viewer ( also, no multipass files are shown ).
So I've decided to just use the CallCommand in the beginning of the script, then have the rest of the code run after that. At least it will render correctly. However, that CallCommand must run in a separate thread because the rest of my code will execute before the render even starts.
I would like:
Step 1: render
Step 2: run remaining code.
I've looked into c4d.CheckIsRunning ( c4d.CHECKISRUNNING_EXTERNALRENDERING )
and that doesn't seem to do anything with the CallCommand. It will return True, execute the rest of the code, then run the CallCommand.
I've scoured the internet looking for similar posts and have not run into any.
Sigh, I am at a loss. Maybe I'm missing something obvious or maybe I just don't understand.
Any help would be appreciated.