On 12/02/2014 at 22:39, xxxxxxxx wrote:
User Information:
Cinema 4D Version: R14
Platform: Windows ;
Language(s) : C++ ;
---------
Hi Folks,
not sure if this is a bug, or if it's intended to be this way. But..
I'm trying to render a document to an image via the software renderer. I can render the scene, and display the image in the viewer. With the following settings applied, it renders as it should:
Software Renderer
Save Boolean = TRUE
File = (location here - must not be blank)
Alpha channel = TRUE
Straight Alpha = TRUE
This gets me a software rendered image, with an accompanying alpha channel in the picture viewer's layer tab. The image in the layer itself is all black (is this a bug?) but the alpha does have data, I can see it when I view it as a single pass. This is when calling the render from pressing the render button.
Now the problems, when I turn off the save bool, the alpha channel is now empty - the layer itself is there, but there is no alpha data in it. Alternatively, if I leave the save bool on, but leave the file location field blank, the alpha channel is also empty with the layer itself still being there.
Similar principles apply to this when running it through code - though I haven't managed to get an alpha channel out of it yet at all (even with the filename field filled and the save bool ticked). Here are my settings for the code side of things:
// BaseDocument *doc --> get/make a document
MultipassBitmap *bmp;
bmp = MultipassBitmap::Alloc(640,480,COLORMODE_ARGB);
BaseContainer rd;
rd.SetLong(RDATA_RENDERENGINE_PREVIEWSOFTWARE);
rd.SetReal(RDATA_XRES_VIRTUAL,640);
rd.SetReal(RDATA_YRES_VIRTUAL,480);
rd.SetBool(RDATA_SAVEIMAGE,TRUE);
rd.SetFilename(RDATA_PATH, "path here..");
rd.SetBool(RDATA_ALPHACHANNEL,TRUE);
rd.SetBool(RDATA_STRAIGHTALPHA,TRUE);
RenderDocument(doc,rd,NULL,NULL,bmp,RENDERFLAGS_EXTERNAL,NULL);
ShowBitmap(bmp);
Is this a bug in R14? Or is it something about the render process I've missed or misunderstood? Fortunately/unfortunately I need this feature to work as it's a part of one of the main features of my plugin!
Cheers,
WP.
P.s. just for reference, here's an older topic where it appears a user was previously able to get it working, albeit on an older version: click me!