Sun, Dec 1, 1:51 PM CST

Renderosity Forums / Poser Python Scripting



Welcome to the Poser Python Scripting Forum

Forum Moderators: Staff

Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 am)

We now have a ProPack Section in the Poser FreeStuff.
Check out the new Poser Python Wish List thread. If you have an idea for a script, jot it down and maybe someone can write it. If you're looking to write a script, check out this thread for useful suggestions.

Also, check out the official Python site for interpreters, sample code, applications, cool links and debuggers. This is THE central site for Python.

You can now attach text files to your posts to pass around scripts. Just attach the script as a txt file like you would a jpg or gif. Since the forum will use a random name for the file in the link, you should give instructions on what the file name should be and where to install it. Its a good idea to usually put that info right in the script file as well.

Checkout the Renderosity MarketPlace - Your source for digital art content!



Subject: Snakehead programming important safety tip #1


jbrugion ( ) posted Thu, 08 February 2001 at 1:48 PM · edited Fri, 29 November 2024 at 10:33 AM

Found out last night that the actor.Geometry() call might throw an error if you try to use it on an actor that has no geometry associated with it. Was trying to loop over the actors in a figure and got an error message in the python window when it tried to get the geometry from the body. Need to wrap that call inside a try-except statement as so: try: tab geometry=actor.Geometry() except: tab # something to do if no geometry present You can see an example of this in the randomize and bulge figure scripts under the Geometry Mods button. For those of you not familiar with exception handlers you put the code that you want to execute, but which might throw an error, in the "try" block and in the "except" block put some code to handle the error condition. If the code inside the "try" block throws an error execution jumps to the "except" block.


CharlieBrown ( ) posted Thu, 08 February 2001 at 2:03 PM

Thanks. And is Important Saftey Tip #2 "No Poofders"?


jbrugion ( ) posted Thu, 08 February 2001 at 2:12 PM

No Party Hardy! Actually, it comes from this dialog which I leave as an exercise for the reader to identify: Wait, I just remembered something important. Don't cross the streams. It would be bad. I'm fuzzy on this whole good / bad thing. Imagine all life as you know it stopping and every molecule in your body exploding outward at the speed of light. Okay, that's bad. Important safety tip. Thanks Egon.


CharlieBrown ( ) posted Thu, 08 February 2001 at 2:21 PM

Ah. I was making a joke based on the origin of the language name (Python Script - Monty Python; on their site they ENCOURAGE the use of Monty Python references in your comments). You just quoted a great but unrelated movie... ;-)


servo ( ) posted Thu, 08 February 2001 at 9:05 PM

I don't know if it's quite kosher to mix Ghostbusters quotes with Aussie Python skits. And there is NO rule six. --



bushi ( ) posted Fri, 09 February 2001 at 12:38 AM

Thanks for the tip. I was thinking of the 'try' more in terms of checking for missing files and the like but your suggestion makes perfect sense.


jbrugion ( ) posted Fri, 09 February 2001 at 11:34 AM

DO use the 'try' for missing file checking. I searched the supplied scripts and noticed that a number of the ones using file I/O were inside exception handlers.


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.