Render Background white and transparent

Dear colleagues,

I need to set the render background to white (until then everything is OK with renderer->SetBackground(1.0,1.0,1.0)) and TRANSPARENT (otherwise my image doesn’t appear, it is everything white).
That’s the problem, I can’t manage to have a white transparten background. I am sure this should be an easy question but I didn’t find a solution for that anywhere.

Thank you in advance!!

I have written an example for you TransparentBackground.py (3.5 KB) . In this a cube is rendered on a Silver non-transparent background and a cone is rendered on MidnightBlue background. You will see that the background is indeed Silver showing that the layer one background is transparent. The proof is that the cube is visible and the background is Silver. I hope this example shows you what to do.


If you need a C++ version, I can translate this for you.

Dear Andrew Maclean,

Is was very useful!! thank you!!