Forum: Poser Python Scripting


Subject: Add lights to a scene lt2-not replace via script

grichter opened this issue on Dec 08, 2012 · 7 posts


lesbentley posted Mon, 07 January 2013 at 5:24 PM

I can't speak on the Python aspect of this issue, but as to the Poser library file aspect...

In P8 and up, you have two ways of loading a light set from the library, Replace (single tick), or Add (double tick). Using Add, you can add as many instances of the light(s) as you like. I don't know if there is any way of choosing between Add and Replace if you are loading the lt2 via Python.  

In P8 and up, if you load a light from a pp2, each new instance will have the name incremented by a number, so you can load any amount of new instances of the light from the same pp2 file (and without affecting existing lights). The pp2 should be in the appropriate folder, I think just renaming an lt2 to pp2 and leaving it in the Light folder may cause problems. It works the same for loading lights from a cr2, but again, a cr2 has both Add and Replace loading modes, so it may not work via Python. A pp2 only has the Add loading mode, so I assume it should work OK via python.

If I remember correctly, the above method does not work in P6, in that version, any method of loading a light will overwrite an existing light of the same name. I don't know how it works in P7, as I never owned that version.

On the separate issue of loading a new light set turning off the pre-existing lights in the scene, I think loading the lights via a cr2 or pp2 overcomes that problem in any Poser version.

When I used P4-P6 I often parented lights to a figure (one with only a BODY actor), so that I could load the light set without turning off other lights in the scene.