Mon, Jan 13, 1:05 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: Helllllllllllllllllp


DSQRD ( ) posted Fri, 19 January 2007 at 7:54 AM · edited Mon, 13 January 2025 at 11:53 AM

I am looking to create my first POSER python script and I'm encountering a killion problems.
What I need python to go is:
at the press of a button;
render the current frame in an animation with the current render settings;
save the resulting .jpg to disk;
increment one frame;
and repeat.

First is this possible in python. ( yes I all ready know about the MAKE MOVIE function in animation but it crashes to often and the lligfhting changes by devine intervention).

Second, within POSER 5,  what are the python equivants of render frame, save output, goto next and repeat process.


PhilC ( ) posted Fri, 19 January 2007 at 8:14 AM

OK on the "Teach a man to fish" principle, rather than me, or someone else just writing the script for you can you show what you have done or outline how you anticipate the logic of the script to be and we can lead you in the right direction.

How does that sound?


EnglishBob ( ) posted Fri, 19 January 2007 at 8:32 AM · edited Fri, 19 January 2007 at 8:33 AM

Quote - render the current frame in an animation with the current render settings;
save the resulting .jpg to disk;
increment one frame;
and repeat.

But... Poser does that already, if you set the animation to render to individual image files... I can't remember the exact procedure since I'm not near a copy of Poser at present, but you'll find the settings you need in the animation set-up window, I think. Edited to add: if you haven't successfully rendered an animation from Poser, I doubt if a Python script will magically fix it for you.


adp001 ( ) posted Fri, 19 January 2007 at 10:35 AM

Seems you want to know how to do it with Python, not Poser :)

Couldn't test it because I'm at work. But I think it should do:

<pre style="background-color:#FFFFFF;padding-left:5mm;">
import poser<br></br><br></br>imgext = "jpg"                      # image format<br></br>imagepath = "c:images"             # path where images are stored<br></br>filename = "newimage_%05d"          # mask for image filenames<br></br>                                    # %05d will be replace with framenumber<br></br><br></br>sf = poser.Scene().Frame()          # save current framenumber<br></br>frcount = poser.Scene().NumFrames() # number of frames available<br></br><br></br>for framenr in range(frcount) :     # loop trough all frames<br></br>    poser.Scene().SetFrame(framenr) # set the framenumber to work with<br></br>    poser.Scene().Render()          # start the render process<br></br><br></br>    # Poser stops python until<br></br>    # the renderprocess is finished<br></br><br></br>    # save the image<br></br>    poser.Scene().SaveImage(imgext,filename % framenr)<br></br><br></br>poser.Scene().SetFrame(sf)          # back to the frame we started<br></br>




DSQRD ( ) posted Fri, 19 January 2007 at 5:54 PM

English Bob - Yes there is a button in the amination menu that does this BUT when I use that method the finished string of .JPGs seam to have tiny movement of lights whick make the finished animation appear to flicker. When I use the render menu to produce the .JPG's the resulting string doesnot display the flicker.

Philc - ADP001 sent a script that might work. Whether it works or needs some tweeking a can follow it enough to figure out where the next stumbling block is.

ADP001 - thanks for taking the time to create this script and adding the text notation.

The first thng i'll be doing is comparing the function calls to what is in the python manual to determine why I couldn't  find them to begin with.


adp001 ( ) posted Fri, 19 January 2007 at 6:11 PM

English Bob - Yes there is a button in the amination menu that does this BUT when I use that method the finished string of .JPGs seam to have tiny movement of lights whick make the finished animation appear to flicker. When I use the render menu to produce the .JPG's the resulting string doesnot display the flicker.

I used this method to produce 3D-animations. Works fine for me. Each stream (left cam, right cam) without flickering.

By the way - In the script above:

<pre style="background-color:#FFFFFF;padding-left:5mm;">
imagepath = "c:images"             # path where images are stored<br></br>

has to be written as:

<pre style="background-color:#FFFFFF;padding-left:5mm;">
imagepath = r"c:images"             # path where images are stored<br></br><br></br>

The little "r" in front of the string means: Do not interpret characters with a leading as special characters (like n). Without "r" it has to be written as "c:images" (double backslash).




DSQRD ( ) posted Sat, 20 January 2007 at 4:59 PM

So far I've learned how to run a Python script and ADP's script will render and run. I haven't tried this script with the change you've suggested but it may clean up  the "save" ossue. Thanks


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.