Forum: Poser Python Scripting


Subject: PoserPython and OnOff?

fretshredder opened this issue on Feb 13, 2003 ยท 5 posts


ockham posted Thu, 13 February 2003 at 3:13 PM

SetOnOff refers to the visibility of the "thing" itself. For a figure or a prop, this is clear: visible only has one possible meaning. But for a light, it's less obvious, because the "thing" representing the light can be visible or invisible, and the light itself can also be emitting rays or not emitting rays. Both of these actions loosely fall into the word "visibility", but they are not the same. SetOnOff always refers to the visibility of the "thing" (more specifically the OBJ or mesh). But in this case the "thing" or OBJ is the outline that shows up on screen in Preview mode. For infinite lights, the "thing" is that set of arrows and curves that shows you where the light goes; for spotlights, the "thing" is that outline shape that looks like a spotlight. Setting the Light to emit rays or not is a completely separate matter; just set the Intensity parameter to 0 to turn it off. So, to do what you're thinking of, you'd want code something like this (untested): Intensity = ThisLight.Parameter("Intensity").Value() Visibility = ThisLight.OnOff() if (Visibility==1) and (Intensity == 0.0): ~scene.SelectActor(ThisLight) ~scene.DeleteActor()

My python page
My ShareCG freebies