different background colors

Need help, or want to share a macro? Post here!
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

different background colors

Post by microelly2 »

Is there a way to set the background colors for different 3D Views independently?
Attachments
bp_308.png
bp_308.png (64.2 KiB) Viewed 528 times
User avatar
yorik
Founder
Posts: 13665
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: different background colors

Post by yorik »

I think it should be possible from pivy:

Code: Select all

Gui.ActiveDocument.ActiveView.getViewer().getSoRenderManager()
User avatar
microelly2
Veteran
Posts: 4688
Joined: Tue Nov 12, 2013 4:06 pm
Contact:

Re: different background colors

Post by microelly2 »

thank you, it works

Code: Select all

p=FreeCAD.ParamGet("User parameter:BaseApp/Preferences/View")
p.SetBool("Gradient",False)

sorendermanager=Gui.ActiveDocument.ActiveView.getViewer().getSoRenderManager()
sorendermanager.setBackgroundColor(coin.SbColor4f(1, 0, 0, 0.5))
sorendermanager.activate()
sorendermanager.render(True, True)
Post Reply