tpaviot / pythonocc-core

Python package for 3D geometry CAD/BIM/CAM
GNU Lesser General Public License v3.0
1.27k stars 365 forks source link

Set the qtViewer3d display with Transparent Background #804

Open HerveGlz opened 4 years ago

HerveGlz commented 4 years ago

Hi all, I am searching for a way to initialize a qtViewer3d display with a transparent background so that the displayer will only show the imported 3d model and the background of the main app containing this viewer. Is there a way to do that ?

What I have right now is the possibility to change the color gradient but I do not succeed in finding a way to add the alpha transparency information (ex: rgba(0,0,0,0))

self.canva = qtViewer3d()

background_gradient_color1 = [255, 255, 255]
background_gradient_color2 = [255, 255, 255]
self.canva._display.set_bg_gradient_color(background_gradient_color1, background_gradient_color2)

Thanks in advance for your help. Warm regards, Hervé

sikula commented 6 days ago

Any updates on this? I'm also looking to generate thumbnails that have a transparent background, this would be very helpful