Hello, I want to hide my light source programmatically (equivalent of doing Light → Show Light [disable] in GUI) with pvpython.
I have tried:
light1 = GetLight(0, renderView1)
Hide3DWidgets(proxy=light1)
which did not work. I am using 5.10, where this method is not deprecated yet (I have seen a deprecated warning on 5.11 here:
https://kitware.github.io/paraview-docs/latest/python/paraview.simple.html
… where it says deprecated:: 5.11 Use HideInteractiveWidgets() instead)
I have also tried HideInteractiveWidgets
, but it does not seem to be a defined keyword in 5.10.1 yet…
Then, I’ve tried just enabling the light and disabling it (as that would normally toggle off ‘Show Light’).
So I did as follows:
light1.Enable = 0
light1.Enable = 1
No effect. The light is still shown in my rendered view…
Finally, I tried just disabling the light altogether:
light1.Enable = 0
… and to my surprise, it still shows up in my rendered view!
NOTE: if I disable the light from inside the GUI, it works.
All these commands also work from the Python Shell.
But my plan to have a pvbatch script, and when when I run my script not interactively, it fails to turn off the ‘Show Light’.