On 09/02/2015 at 10:58, xxxxxxxx wrote:
First the 3 following lines are useless because Cinema will assign the rendered preview bitmap 'dst':
dst = bitmaps.BaseBitmap()
safedoc = c4d.documents.IsolateObjects(doc, [self.node])
dst = safedoc.GetDocPreviewBitmap()
c4d.documents.SaveDocument(safedoc, filePath, 0, c4d.FORMAT_C4DEXPORT)
For GetDocPreviewBitmap() to work, the document to get the preview for needs to be saved before.
In other words, documents.SaveDocument(safedoc) has to be called before safedoc.GetDocPreviewBitmap().
This is because GetDocPreviewBitmap() doesn't render the preview each time it's called. It rather returns a cached bitmap.
This works well with already saved documents, but with documents saved by scripts it's harder to get it to work. I'll post a solution as soon as I find it.