# Cannot Hide Light with pvpython

**URL:** https://discourse.paraview.org/t/cannot-hide-light-with-pvpython/10257
**Category:** ParaView Support
**Tags:** python
**Created:** [September 6, 2022, 8:46pm UTC](https://discourse.paraview.org/t/cannot-hide-light-with-pvpython/10257 "2022-09-06T20:46:19Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![Dosmi](https://discourse.paraview.org/user_avatar/discourse.paraview.org/dosmi/32/9675_2.png) [@Dosmi](https://discourse.paraview.org/u/Dosmi)
#### Post date: [September 6, 2022, 8:46pm UTC](https://discourse.paraview.org/t/cannot-hide-light-with-pvpython/10257/1 "2022-09-06T20:46:19Z")

</div>

Hello, I want to hide my light source programmatically (equivalent of doing Light → Show Light [disable] in GUI) with pvpython.

I have tried:

```auto
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](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:

```auto
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:

```auto
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’.

---

<div class="post-metadata">

### Author: ![Dosmi](https://discourse.paraview.org/user_avatar/discourse.paraview.org/dosmi/32/9675_2.png) [@Dosmi](https://discourse.paraview.org/u/Dosmi)
#### Post date: [September 7, 2022, 1:47pm UTC](https://discourse.paraview.org/t/cannot-hide-light-with-pvpython/10257/2 "2022-09-07T13:47:17Z")

</div>

Fascinating… The problem was that on the GUI, I had my Light Inspector (View → Light Inspector) turned on on the side. Once I turned it off, my script works as expected.

Also I can confirm this is not a problem when running with pvbatch, since there is no notion of a ‘Light Inspector View/Window/Panel’ there.

It seems that the Light Inspector overrides the script input.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [September 8, 2022, 6:19am UTC](https://discourse.paraview.org/t/cannot-hide-light-with-pvpython/10257/3 "2022-09-08T06:19:57Z")

</div>

Can you share exact steps to reproducce ? Im not able to reproduce here.

---

<div class="post-metadata">

### Author: ![Dosmi](https://discourse.paraview.org/user_avatar/discourse.paraview.org/dosmi/32/9675_2.png) [@Dosmi](https://discourse.paraview.org/u/Dosmi)
#### Post date: [September 8, 2022, 10:24am UTC](https://discourse.paraview.org/t/cannot-hide-light-with-pvpython/10257/4 "2022-09-08T10:24:43Z")

</div>

This post already has a solution. See Post #2 for a chance to reproduce it (seems like if you run your pvbatch script from GUI, and have the Light Inspector window/panel open, the pvbatch command does not work)
