Forum: Poser Python Scripting


Subject: Is Actor.OnOff() broken for lights?

face_off opened this issue on Dec 29, 2004 ยท 3 posts


face_off posted Wed, 29 December 2004 at 3:49 PM

Hi All I print str(Actor.OnOff()) for each light in my scene (some being on, and some off), and each light prints "0" (so the method is returning 0 regardless of the light state). Anyone else noticed this? Am I doing something wrong, or is it a P5 glitch?

Creator of PoserPhysics
Creator of OctaneRender for Poser
Blog
Facebook


PoseWorks posted Thu, 30 December 2004 at 1:58 AM

Actor.OnOff() refers to whether or not the actor representing the light is displayed in the scene, not whether or not the light is turned on. Since Poser's global lights don't display by default, you're getting zero for all of them. As far as I know, there's no way to directly query whether a light is turned on or off. (Unfortunately, you can't access it as a Parameter either.) You would have to use Scene.SaveLibraryLight() and then collect the information from the LT2 file.


face_off posted Thu, 30 December 2004 at 2:57 PM

Thanks PoseWorks - that makes sense. Saving to a light library is probably too much hassle for what I need to do. Thanks for your reply.

Creator of PoserPhysics
Creator of OctaneRender for Poser
Blog
Facebook