Tutorials

Quick View Other Tutorials   

Using Python to Parent Infinite Lights in Poser® Radiosity

For use with Poser 6, Poser 5 and Pro Pack

New changes have been taking place in the world of lighting within Poser through the efforts of some innovative thinking on the part of the Poser community.By Cris Palamino

New changes have been taking place in the world of lighting within Poser through the efforts of some innovative thinking on the part of the Poser community. Taking the concept of radiosity from high-end 3D packages such as Lightwave and constructing a radial sphere in Poser, users have been obtaining some very realistic results in their renderings. Light packages, such as those sold by Michael Lane, have given users the opportunity to bring this realism to their work. The grand thing about this is that new ideas to improve and push the envelope further always harken on the horizon.

In working with John Brugioni, who has made the Conforming Clothing sets for Victoria 2, the Kids and several other things, I set out to see how these light set-ups were accomplished and what new developments could be found using the powerful language of Python.

The light sets, I have seen thus far, make the supposition that your figure will be globally centered. This insures that the intended lighting will fall upon your figure correctly and give you a realistic rendering with any light attributes the light designer has implemented such as Michael Lane's Firelight in the initial set-up you see below.

The only problem is that I am applying the Firelight to a character, Liliana, that I had already made for another purpose and she is not centrally located.

The resulting render is pretty, but the light has been become dispersed and washes over the entire figure instead of the warm glow it was meant to give.

After discussing the problem with John, he created a python script which would parent all the lights to an actor such as the figure's hip. Now some interesting things occured.

Most of the radiosity light sets use infinite lights, but only spot lights parent. I tinkered with the python set-up and found that python overrides that little rule and parents the infinite lights.

Selecting Python Scripts from the Window palette...

I located and loaded the ParentAllLights.py script John had created into an empty slot on the Python Dialog box.

I wanted the lights parented to the figure's hip, but you may have more than one figure or item which contains an actor named hip. Therefore, John gave me the ability to give the actor a unique name with a prefix. In this case, I used LilHip because my figure's name is Liliana. Rename the hip by using the Element Properties in the Object menu.

Edit the python script to reflect the name you have given your hip. This is accomplished by clicking on the script in the Python window with the Control key on the Mac and the Alt key on the PC . The text version of the script will appear and you can edit the needed portion of the script as shown:

# Set the name of the PROP actor to parent to

#

parentName="LilHip"

Close and save the script.

Now, clicking the python script, all the lights are selected and parented to the hip which results in the set-up below.

Notice that the Firelight set contains two colored infinite lights that first appeared front and center on Poser's Light Globe.

The figure is turned and the parenting does the same to the lights. They have followed the positioning of the figure's hip.

Now look at how the render recaptures the intended lighting of Michael Lane's Firelight set.

So, then I decided that I wanted to create a radial globe with lights placed in an even dispersement. I wanted to be able to change out the Firelight set for my own to experiment with, but it is hard to delete lights. What happens is that not all the lights are necessarily replaced. As you can see here, all my lights are the white ones and any dark ones are left over from the Firelight set.

Again with John's assistance, he provided me with a python solution and, voila, lights out.

Now I was free to implement my own lights...

which I, again, want to parent the lights and reapply the python script.

John gave me the power, through his python scripting, to select multiple lights and change their intensity and other attributes including the selection of infinite or spotlights. I chose to make the lights above the midline one intensity, the midline almost black, and those below the midline a third intensity. This is the result.

John and I are excited about putting together a new set of lights and python scripts for your use and will be brokering them through DAZ () in the very near future. Until then, please feel free to download the python script used in this tutorial. It has been tested on both Mac and PC. Simply edit the script with whatever unique name you give the part of your figure to which you wish to parent. We would love to see any images you create and any comments you may have on the script or any other part of this tutorial.

John Brugioni may be contacted at redink3d@earthlink.net. My email address is elektralusion@elektralusion.com.

The Firelight set used in this tutorial is from Michael Lane's Lighting Environment and is available through DAZ at text="http://www.daz3d.com" in their brokering section.