THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 21/08/2008 at 17:43, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 10.008
Platform:
Language(s) : C++ ;
---------
I'm trying to generate a quick preview render - basically a screen capture of the current editor view. What I have done thus far is to change my render settings to render as editor, then generate a render. This works fine, except for when large particle systems are in the project. Cinema pre-rolls and calculates all the particles before generating the render, which can take several minutes to half an hour, depending on which frame the user is parked on. I have tried setting my render flag to RENDERFLAG_PREVIEWRENDER, but that only generates a completely white image. Not sure why... I had my thread parameter set to NULL, but even when setting it to my own thread, I still get a white frame. I have also tried variations with RENDERFLAG_NODOCUMENTCLONE added as well with the same results. Unless I'm using RENDERFLAG_EXTERNAL I get a white frame.
Here is some of my code...
//To set up thread...
class RenderThread : public Thread
{
public:
virtual void Main(void);
virtual const CHAR *GetThreadName(void) {return "My Thread";}
}
void RenderThread::Main(void)
{
}
//Generate the render. All render settings have already been set...
AutoAlloc<BaseBitmap> bmp;
bmp->Init(renderData->GetLong(RDATA_XRES), renderData->GetLong(RDATA_YRES));
C4DAtom* docCloneAtom = doc->GetClone(COPY_DOCUMENT, NULL);
BaseDocument* docClone = (BaseDocument* )docCloneAtom;
StopAllThreads();
RenderThread myThread;
myThread.Start(FALSE);
RenderDocument(docClone, docClone->GetActiveRenderData()->GetData(), NULL, NULL, bmp, RENDERFLAG_NODOCUMENTCLONE || RENDERFLAG_PREVIEWRENDER, myThread);
Any advice on setting up a thread correctly for rendering or disabling the render preroll would be greatly appreciated.
Thanks!
Adam