On 10/04/2013 at 08:23, xxxxxxxx wrote:
Hello there!
I want to render several pictures where the objects in the scene get different materials. After rendering the rendered images should be automatically saved. But with my code C4D doesn't save the images at all.
Here's the interesting part of my code:
def Execute(self, doc) :
WTO = WalkThroughObjects(doc) #helps me to handle objects
rdata = doc.GetActiveRenderData()
renderData = rdata.GetClone(c4d.COPYFLAGS_NO_HIERARCHY)
renderData[c4d.RDATA_XRES] = 1280
renderData[c4d.RDATA_YRES] = 1024
renderData[c4d.RDATA_SAVEIMAGE] = True
renderData[c4d.RDATA_FORMAT] = c4d.FILTER_PNG
renderData[c4d.RDATA_FORMATDEPTH] = c4d.RDATA_FORMATDEPTH_16
renderData[c4d.RDATA_FRAMESEQUENCE] = c4d.RDATA_FRAMESEQUENCE_CURRENTFRAME
matList = doc.GetMaterials()
for mat in matList:
self.removeAllTags(doc, WTO)
self.setObjectsMaterials(doc, WTO, mat)
rPath = 'Rendering_{0}.png'.format(mat.GetName())
renderData[c4d.RDATA_PATH] = rPath
print rPath
renderBmp = c4d.bitmaps.BaseBitmap()
renderBmp.Init(x=renderData[c4d.RDATA_XRES], y=renderData[c4d.RDATA_YRES], depth=32)
documents.RenderDocument(doc, renderData.GetData(), renderBmp, c4d.RENDERFLAGS_EXTERNAL)
c4d.bitmaps.ShowBitmap(renderBmp)
print 'Material rendered: ', mat.GetName()
The help of C4d states
Geben Sie statt eines Pfades nur einen Namen ein, werden berechnete Bilder oder Animationen im selben Verzeichnis abgelegt, in dem sich auch die Szene befindet.
Translated: If there is only a name not a path given, rendered pictures or animations will be saved in the same folder as the scene.
So what do I miss? From my sight of view there is nothing wrong. Any help would be appreciated