Mon, Dec 2, 5:35 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 Dec 02 3:16 pm)

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: how to terminate a batch render script.....


dennisharoldsen ( ) posted Tue, 19 February 2008 at 11:00 PM · edited Mon, 02 December 2024 at 5:34 PM

i use scripts to batch render, among other things.

is there a way for a user to interupt and terminate the script in process?

killing the poser process seems a little extreme but that's all i know.

any ideas would be appreciated. thanks.


nruddock ( ) posted Wed, 20 February 2008 at 12:18 AM

Quote - killing the poser process seems a little extreme but that's all i know.

And it's the only one there is AFAIK as well.

The Render() method is sychronous (i.e. it doesn't return until the rendering process completes), so there is no opportunity to do anything to interrupt.
Even if there was a method you could call to abort a render, it would require you to be able to work with an extra thread within Poser Python and last time I checked, threads weren't behaving Pythonwise.


dennisharoldsen ( ) posted Wed, 20 February 2008 at 12:24 AM · edited Wed, 20 February 2008 at 12:27 AM

hi nruddock

i am not rendering all the time if that makes a difference.

i load a pz3, render, and then save the png file before continuing on..

does that make a difference? i use sleep in the cycle, too.

i have used callbacks but didn't see anything on user input.


nruddock ( ) posted Wed, 20 February 2008 at 1:35 AM

Quote - does that make a difference? i use sleep in the cycle, too.

It does make a difference.

You need to create a Tk dialog (to give you a button) and then use a timer to trigger the next render if the button hasn't been pressed, or abort the script if the button was pressed.

You may be able to use a Python Timer from the threading module, but I'd suggest looking up the Tk after and after_cancel methods as these might be easier to use (and in case the threading Timer class doesn't work).


dennisharoldsen ( ) posted Wed, 20 February 2008 at 1:51 AM

cool. thanks a lot. i don't know how you know this stuff.

i appreciate having a starting point because poser is such a mystery to me.

i have an external app i use to control poser and killing it is fine for me, however, i thought others that don't use task manager might want to use some of the scripts

in the interim, i made a script that sits on the desktop that closes poser with a click.

sometime i click it just for fun and maybe to get even.

i really hate it when there are several texture links and poser just keeps going on and on asking me to locate them. (maybe i am a little on the impatient side.)


markschum ( ) posted Wed, 20 February 2008 at 10:05 AM

There is a way to shut batch processes down without a user interface but its a bit old school.

Simply have the program check for the existance of a file , if the file exists then shut down , otherwise continue. or the other way around .   You can get it to read a file and get parameters passed in that way , like a file list to load and render , but a file exists test is pretty simple to imlement.

That wont get you an abort of the process though , it will give you a stop at the beginning of a loop though .


dennisharoldsen ( ) posted Wed, 20 February 2008 at 12:48 PM

markschum:

that sounds good and i could do it with what i already know how to do.

i had in mind only aborting the script, but when i thought about this, i realized that i could pause and recommence the batch. you have also added the possibility of passing information to the script in a simple manner.

thanks a lot for the suggestion.

 


markschum ( ) posted Wed, 20 February 2008 at 6:37 PM

No problem , it was an old technique used for Never ending programs in the Dark Ages of data processing .
 


dennisharoldsen ( ) posted Wed, 20 February 2008 at 7:28 PM

markschum:

i would like to hear more about the dark ages. i started programming when they were phasing out steam power and going to electricity. actually, that's not too far from the truth. i start at boeing aerospace in the 70's before many companies had computers. i did a little bit with punch cards there and at school and got one of the first crt's. everyone said i should get to work and quit watching tv.

i like what we can do today much better but poserpython has caused me to resort to trial and error instead of using documentation and anything that might work. the assistance i have gotten from you and a few others in understanding poser has been greatly appreciated.

i live on bainbridge island across from seattle and am only working on my own projects these days. i would like to hear more about your experiences if you'd like to share them. i think i might understand.


markschum ( ) posted Sat, 23 February 2008 at 9:14 PM

You lucky person , to have steam , incredible ...   :)

I started on NCR criterion mainframes , complete with card readers , and the old style monster tape decks . Most batch jobs were card deck, for the job, tape input and output with a very few master files on removable disk platters , about 20 pounds weight for I think about 200 megs of storage .  Disk controllers were about 5 x 4 x 4 feet big and were booted off cassette tape . Onsite engineer to keep things running .

Then the site went to IBM s/36 with 60 meg hard disk and S/38 with a IBM mainframe. Actual disk units.  Changed to AS/400 eventually .

Makes me feel ancient when people start complaining about the render times of the desktop PC, more powerful than the old mainframes. I sometimes wish everyone had to make 10 pictures on an old processor with Povray. Render times measured in days or weeks .  You mention that there were no pc's when you were in high school and they start to look at you oddly. 

If you dont have it get the documentation from www.python.org.   Poser python supports a lot of it. The folder and file management and file access all work .
the modules OS, shutil and string are all useful.
 


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.