ViewCapture plot with transparent background issue

For the attached 3dm filem, if we plot with transparent backgroud, it will show as the below image, but if we set the transparent background to false, it will plot as what it displayed in Rhino(the last image), we do need transparent background, but how to fix the plot issue, then? Thanks a lot!

                Bitmap bmp = null;
                if (this.ViewCapture == null)
                {
                    this.ViewCapture = new ViewCapture()
                    {
                        ScaleScreenItems = false,
                        DrawAxes = false,
                        DrawGrid = false,
                        DrawGridAxes = false,
                        TransparentBackground = true
                    };
                }
                this.ViewCapture.Width = rhinoView.ActiveViewport.Size.Width;
                this.ViewCapture.Height = rhinoView.ActiveViewport.Size.Height;
                bmp = this.ViewCapture.CaptureToBitmap(rhinoView);
                bmp.Save(path);

2.3dm (4.6 MB)
2_Front

image

Hi @Robin3,

the command ViewCaptureToFile exhibits the same issue, so i do not think this is a code related problem. If you change the material type of the material named “Plastic (1)” to Custom, the capture with transparency seems to behave. I am not sure what causes this.

_
c.

Thanks Clement, however, we can’t change material type then, because it is supposed to be an user’s file, which we can’t change, so, the ViewCapture codes need to be changed? Thanks a lot!

I don’t think so. The problem seems to be material type related and can be repeated without using your file or any code:

@pascal or @wim, can you confirm and try to repeat the following:

Open new document, add a box,
Create a new material of type Plastic and assign it to the box,
Switch view to Rendered display mode,
Run _-ViewCaptureToFile, Preview with Transparent Background checked looks like this (OK):

Next please change the color of the Plastic material to any other color than white and run _-ViewCaptureToFile again, the preview looks like this (not looking OK):

_
c.

Thanks Clement, so, anyway to bypass it then, instead of change the material type, Thanks a lot!

Hi Clement - I think it is this -

RH-69324 ViewCapture: Some materials transparent

-Pascal

1 Like

We are close to release, any fix or bypass would be great appreciated, Thanks a lot!