i've resolved the problem changing creation of bmp using method MultipassBitmap:
# Ottieni le impostazioni di rendering correnti
rd = doc.GetActiveRenderData()
# Crea un nuovo bitmap
# bmp = bitmaps.BaseBitmap()
bmp = bitmaps.MultipassBitmap(int(rd[c4d.RDATA_XRES]), int(rd[c4d.RDATA_YRES]), c4d.COLORMODE_RGB)
bmp.AddChannel(True,True)
if bmp is None:
return
# Imposta la risoluzione del bitmap
#bmp.Init(x=int(rd[c4d.RDATA_XRES]), y=int(rd[c4d.RDATA_YRES]), depth=32)
# Esegui il rendering
result = c4d.documents.RenderDocument(doc, rd.GetData(), bmp, c4d.RENDERFLAGS_EXTERNAL)
if result == c4d.RENDERRESULT_OK:
bmp.Save(output_file, c4d.FILTER_PNG)
print("Rendering completed successfully.")
else:
print("Error during rendering.")
Thanks you all for your suggestions