Sun, Jan 12, 3:23 AM CST

Renderosity Forums / Poser - OFFICIAL



Welcome to the Poser - OFFICIAL Forum

Forum Coordinators: RedPhantom

Poser - OFFICIAL F.A.Q (Last Updated: 2025 Jan 11 12:18 am)



Subject: Python script Deletelights...deleting more than lights!?


dreamer728 ( ) posted Sun, 18 May 2003 at 7:34 PM · edited Wed, 01 January 2025 at 7:33 AM

Every time i run this python script, it sets all my dial settings, pose, everything back to 0. Its pretty frustrating...what am i doing wrong? --I'm using P5-- I add the script to a button, that's easy enough, then i click, it deletes all the lights...then the screen flashes white and when it comes back...POOF...all my work is gone. I have all the updates - figures, Sr3, vicki updates, etc. This happened most recently with V3, morphed and posed against a wall. I wanted to delete all the lights and aim 3 lights at her to create a cool shadow effect...


dreamer728 ( ) posted Sun, 18 May 2003 at 7:37 PM

now that i think about it, this didn't happen before sr3...could this be a new burp in poser? running windows xp home with all the pretty stuff turned off 1.8Ghz pentium 4 256 MB ram


ockham ( ) posted Sun, 18 May 2003 at 8:41 PM

Hmm. I haven't bothered to get SR3. Maybe I should DL it to check this. SR3 supposedly changed some parts of Python for the first time in P5. Just to be sure we're talking about the same thing, are you using the version of the script with file date 11/02/02?

My python page
My ShareCG freebies


dreamer728 ( ) posted Sun, 18 May 2003 at 9:23 PM

file date: 1/14/2003 i opened it up in a text editor and here is what it says: #----------------------------------------------------------------------------- # Delete all lights. #----------------------------------------------------------------------------- import poser #----------------------------------------------------------------------------- scene = poser.Scene() scene.SetFrame(0) #----------------------------------------------------------------------------- #----------------------------------------------------------------------------- # Run a loop across frames. # At each frame, delete any lights. #----------------------------------------------------------------------------- for OneLight in scene.Lights(): scene.SelectActor(OneLight) scene.DeleteCurrentProp() # Wipe it. # That's all, folks! #-----------------------------------------------------------------------------


Dave-So ( ) posted Sun, 18 May 2003 at 9:29 PM

I sent this in as a bug when SR3 first was released..requested by CL after I posted a comment earlier..you should go to their site and send this in as well so they know its happening to more than just one person.

Humankind has not woven the web of life. We are but one thread within it.
Whatever we do to the web, we do to ourselves. All things are bound together.
All things connect......Chief Seattle, 1854



ockham ( ) posted Sun, 18 May 2003 at 10:13 PM

Okay, the script itself is unchanged. I just DL'd the new SR3 and tried it; the script takes -significantly- longer than usual (like 2 seconds per light) but I didn't have a disaster. The delay could indicate that something strange is going on, because this script acts instantly in P4. I'll keep watching this. Right now I'm in the middle of a scramble toward deadline on current paid project, so I'm not in Rosity as often as usual.

My python page
My ShareCG freebies


ockham ( ) posted Sun, 18 May 2003 at 10:28 PM

Attached Link: http://ockhamsbungalow.com/Python/DeleteLightsP5.zip

Found the problem. Essentially, P5 replaced the DeleteProp command with a Delete command that acts differently. But until this SR, the older version would still work. It appears that SR3 stopped maintaining the compatibility. I rewrote the script to use the P5 style, and this seems to behave more normally; acts instantly. Give it a try and see if it works properly for you. Note that this version is ONLY for P5, any SR, and will not work in P4.

My python page
My ShareCG freebies


ockham ( ) posted Sun, 18 May 2003 at 10:34 PM

Consider this to be a temporary fix. If it works for you, I'll rig up a way to use the same script for both versions; internally check the Poser version and use the proper action for each.

My python page
My ShareCG freebies


dreamer728 ( ) posted Sun, 18 May 2003 at 10:51 PM

It works perfectly :-) Wow...thanks for the quick response, and fix! Honestly, i don't know what i would do without your script! I have a tendancy to play with a lot of lights, scrap it and start over, so this has come in handy more often than any other freebie i have ever downloaded! thanks! Brooke


sandoppe ( ) posted Mon, 19 May 2003 at 12:06 AM

Thanks ockham! I use your script constantly. It's a must when using any lights in P5 except the default ones. I haven't installed SR3 and have had no problems at all with your previous script under SR2, but will keep this revised version in a safe place in the event I decide to install SR3.


ockham ( ) posted Mon, 19 May 2003 at 12:12 AM

Thanks to both of you for nice acknowledgements. Since it looks like SR3 is breaking compatibility, I'll have to sift through my available scripts to see how many are affected by this. Likely some others besides this one.

My python page
My ShareCG freebies


BluesPadawan ( ) posted Mon, 19 May 2003 at 12:28 AM

I'm using Poser 4 Pro Pack and experienced the same problem, so I haven't been using the script lately due to having to recreate the wheel. Could it be possible that it too might be having some problems?


FishNose ( ) posted Mon, 19 May 2003 at 2:46 AM

Excellent! Thanks ockham, much appreciated. :] Fish


ockham ( ) posted Mon, 19 May 2003 at 10:10 AM

If you're having similar problems in P4, it's a different matter. There has always been something slightly flaky about the Delete action when taken through Python. Deleting "solid" things sometimes leads to crashes. (Seems to be one of those memory-leak issues that varies strongly with the computer system and the orbit of Pluto.) I hadn't seen the flakiness with lights, though; this script -seemed- to be problem-free until this compatibility change.

My python page
My ShareCG freebies


Dave-So ( ) posted Mon, 19 May 2003 at 11:18 AM

thanks ockham :) I'll give this a try this evening

Humankind has not woven the web of life. We are but one thread within it.
Whatever we do to the web, we do to ourselves. All things are bound together.
All things connect......Chief Seattle, 1854



compiler ( ) posted Mon, 19 May 2003 at 3:48 PM

Thanks a lot ockham. This script is my main workhorse in P5.


stewer ( ) posted Thu, 22 May 2003 at 9:35 AM

Ockham - why do you iterate over all frames and all actors? A delete lights script doesn't need to be more than just import poser scene = poser.Scene() if (poser.Version() != "4.2"): ~for light in scene.Lights(): ~~light.Delete() else: ~for light in scene.Lights(): ~~scene.SelectActor(light) ~~scene.DeleteCurrentProp()


Privacy Notice

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.