On 14/02/2015 at 18:57, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R14
Platform: Windows ;
Language(s) : C++ ;
---------
Hi folks,
just dropping by briefly while in temporary cryo-status.
I've been close to this one before in another thread, but I'm wanting to use LoadDocument instead of LoadFile so that the scene is open in memory only, and not accessible to the user.
I have a function to deal with the loading and rendering. Nothing fancy. Simplified function example here:
void My_Plugin::RenderMe(Filename FN,C4DThread* Thread)
{
BaseDocument *doc = NULL;
if(Thread == NULL)
{
doc = LoadDocument(FN,SCENEFILTER_0,Thread->Get());
}
else
{
doc = LoadDocument(FN,SCENEFILTER_0,Thread->Get());
}
MultipassBitmap *Mp;
Mp->Alloc(...);
Mp->AddChannel(TRUE,TRUE);
BaseContainer rd;
....set render flags etc here....
if(Thread == NULL)
{
RenderDocument(doc,rd,NULL,NULL,Mp,RENDERFLAGS_EXTERNAL,NULL);
}
else
{
RenderDocument(doc,rd,NULL,NULL,Mp,RENDERFLAGS_EXTERNAL,Thread->Get());
}
ShowBitmap(Mp);
}
The issue is that the rendered image always returns blank, regardless of thread context. The main thread gives the same blank result. Oddly enough, the camera position is located where the editor camera would be if the file was open and in editor camera mode. I can see the grid and world axis (I'm rendering in software preview mode). But no objects etc are rendered. Is there something I'm suppose to do in order to "initialise" the scene before I render it?
The second issue I'm having, is that I'm not getting an alpha channel rendered. I've had this issue before which I raised in another topic, but it's never been resolved. I now need this to work too. Does someone have a working example of rendering to memory with the alpha channel valid - one that doesn't require the image to be saved?
Thanks folks,
WP.