Forum: Poser Python Scripting


Subject: Help needed with a script to witch off all lights

jenay opened this issue on Jul 12, 2008 · 5 posts


jenay posted Sat, 12 July 2008 at 6:51 AM

I am no longer sure, if it can be done with Poser5. I want to switch off
all lights of a given scene, without deleting nor changing the values and - optional -
to switch them on again.
here is a small script that does the job, but it's not exactly what I
envisioned. If I set all intensity values to 0, I cannot restore the original intensity
settings.
---8<---

Set Intensity of All Lights to 0

import poser

scene=poser.Scene()
lights=scene.Lights()
for light in lights:
 actor = scene.Actor(light.Name())
 print(actor)

for dials in actor.Parameters():

print (dials.Name())

 actor.Parameter("Intensity").SetValue(0)
scene.DrawAll()
---8<---

I found the SetOnOff method, but for the lights it is not what I need.
It only switches the "faked" light objects on and off, but not the lights
themselves.

some tips appreciated :)