On 14/03/2013 at 10:00, xxxxxxxx wrote:
Hey everyone,
Sorry for bothering you all so soon again, but i have some code in a python plugin, that starts several renders, and while it renders, cinema freezes. It doesn't become unresponsive per say, i just can't do anything until the rendering of the sequence is finished. If you have a scene rendering for like 15 mins or a sequence/animation, you have to wait forever. Is there a way to keep that from happening?
My code looks like this:
def renderDocument(self, layerName) :
"""
Taking the document and rendering it according to the normal rendersettings of the document.
Ads '_LAYERNAME', LAYERNAME being the name of the layer, to the renderpath.
"""
doc = c4d.documents.GetActiveDocument()
renderData = doc.GetActiveRenderData()
xResolution = int(round(renderData[c4d.RDATA_XRES]))
yResolution = int(round(renderData[c4d.RDATA_YRES]))
pathChange = False
if renderData[c4d.RDATA_PATH] != "":
storedPath = renderData[c4d.RDATA_PATH]
renderData[c4d.RDATA_PATH] =r'{0}_{1}'.format(renderData[c4d.RDATA_PATH], layerName)
c4d.EventAdd()
pathChange = True
renderBmp = c4d.bitmaps.BaseBitmap()
renderBmp.Init(x=xResolution, y=yResolution, depth=32, )
result = documents.RenderDocument(doc, renderData.GetData(), renderBmp, c4d.RENDERFLAGS_EXTERNAL)
if pathChange == True:
renderData[c4d.RDATA_PATH] = storedPath
if result==c4d.RENDERRESULT_OK:
c4d.bitmaps.ShowBitmap(renderBmp) # show image in pictureViewer
return True
How could i tackle that?
Or is there even a way to create custom layers (like for example ao pass, just with custom content?), so that i could render everxthing at once?
Thanks in advance
Aurel