Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Dec 02 3:16 pm)
First, you don't need to do the SelectActor step in this case. Second, the light functions need to be attached to the light variable, not to the Scene variable. Here's a script that works: for OneLight in scene.Lights(): # Go through all lights ~OneLight.SetRayTraceShadows(0) # turn off RayTrace This works on my P5, but remember that the new functions are only available in SR3.
My python page
My ShareCG freebies
I should add that, of course, you need the usual overhead stuff, but you know that part. import poser scene = poser.Scene() for OneLight in scene.Lights(): ~OneLight.SetRayTraceShadows(0)
My python page
My ShareCG freebies
One general rule that might help: SelectActor and SelectFigure are just about useless. CurrentActor and CurrentFigure are very useful, because one common use of a script is to select a Figure or Actor by clicking in the display, then apply the script to whatever is already selected. But there's just not much reason to do the -selection- inside the script. The sole exception I can recall is in P4, where deletion involves calling SelectActor and then DeleteCurrentActor. But that's been cleaned up in P5 with a more direct Delete function. Other than that, I can't think of any good reason to use Select at the Python level.
My python page
My ShareCG freebies
This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.
I'm getting right (insert swear words here) with Python today. I've managed to get a nice little script that selects each light in turn, but I can't work out how to have it set the ray trace shadows option. here's the script I have so far import poser scene=poser.Scene() lights=scene.Lights() for light in lights: actor = scene.Actor(light.Name()) scene.SelectActor(actor) scene.SetRayTraceShadows() doesn't work, what am I doing wrong?