Sun, Jan 5, 8:06 AM 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: Auto camera turning, animation rendering?


Tiny ( ) posted Wed, 01 October 2003 at 6:26 AM · edited Sun, 05 January 2025 at 7:50 AM

I've searched for a Python script which will rotate the Aux camera in 11,25 steps. For each step rendering the animation as images and saving to disk.
Close the current Poser file, open next and do the same as above.
I think it ought to be possible in Python. Any good (or bad.. ;o) )person have energy and time to help me with this?

Tiny

(I read Jiia's post from last year and I've sent him a IM.)



ockham ( ) posted Wed, 01 October 2003 at 4:25 PM

It's easy enough, but I don't know what you mean by "11,25". Do you mean steps of 11.25 degrees? Or 11 different steps of 25 degrees?

My python page
My ShareCG freebies


Tiny ( ) posted Thu, 02 October 2003 at 5:23 AM

I mean steps of 11.25 degrees. It makes 32 direction of the 360 degree circle. :o)
Sorry I was unclear.



ockham ( ) posted Thu, 02 October 2003 at 8:26 AM

Ah! I figured you were using the European decimal. The number 11.25 isn't a "familiar" value, but 360/32 makes sense. I can modify an existing script to do this quite easily. The only limitation is that Python can't save a render in "New Window". It can render to the display, or render to New Window; it can save the display to disk, but it can't save the New Window to disk. So if don't need really large images, this is possible.

My python page
My ShareCG freebies


Tiny ( ) posted Thu, 02 October 2003 at 3:26 PM

I'm not sure if I understand the it can't save to disk. If it only saves the main window I guess the resolution isn't at its best? What is the resolution for main window, do you know?

Anyhow, I will explain a little more of what I am hoping to accmplish here.

The animation have 8 frames.
The character in the animation will be rendered for 32 directions (360/32).
The window is approx. 200 x 200 pix.
The animation is to be rendered as images. Preferably at 300 dpi.
The images will after render be moved into another application where I put together a computer game.

I have in all 13 characters with at least 5 animations each. All are to be rendered as above.

I was hoping Python could do some of the work. =o)

BTW, thank you for taking time with this!



ockham ( ) posted Thu, 02 October 2003 at 4:03 PM

For 200 x 200, the main window will be just fine. I'll work on this. Explanation: For some reason the Python system is able to save the pictures in the main window as BMP files, but can't do anything with the New Window (which is where really big pictures go). Python can render a series of images to the New Window, but they will just "pile up" on the workspace, and you still have to save them manually, which makes the automation hardly worth doing in that case.

My python page
My ShareCG freebies


Tiny ( ) posted Fri, 03 October 2003 at 3:36 AM

Ok, I understand. Thanks a lot! :o)



ockham ( ) posted Sat, 04 October 2003 at 12:00 PM

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

file_78315.jpg

Try it now. I *think* it does what you want.... You should have all your PZ3's in one folder to begin with, or at least in related subfolders. In the upper blank, fill in the directory that holds all the PZ3's. (They can be in subfolders UNDER this folder, but not anywhere else.) Hit Enter. You'll see a list of all PZ3's in the area. Single-Click to highlight the ones you want to render, or hit Select All. When you hit OK, the rendering will start. Note: I couldn't find a way to set the DPI or the window size from Python, so you'll have to set those manually in each PZ3. Also, be sure all the render options you need (anti-alias, etc) are set properly for the Display window. The script just takes those as they exist. The rendered BMPs will go into the same folder where the script lives, so be sure to put it in an empty folder before anything else.

My python page
My ShareCG freebies


Tiny ( ) posted Sat, 04 October 2003 at 12:21 PM

Great! I'll try it out. Thank you so much!



Tiny ( ) posted Sat, 04 October 2003 at 3:00 PM

Incredible!
It does almost everything. ;o) It is a joy to see.
I have tested with less directions and that works fine too.

What it does and does not do:

Renders the directions -1, the last one.
Renders the amount of frames in the animation but with the first frame as motif.
Changes Pz3 file with no problems.
Accepts other amount of directions ie 4.0, 8.0. etc. with no problem (besides the -1 rendering of last direction).
Stops the script correctly.

So, are these major problems or can they be solved?
The script is useful even as it is. Saves lot of work. But "me want more"! :o)



ockham ( ) posted Sat, 04 October 2003 at 3:11 PM

The n-1 problem is easy to solve. I can add entry blanks to change the number of steps more easily. What do you mean by "first frame as motif"?

My python page
My ShareCG freebies


Tiny ( ) posted Sun, 05 October 2003 at 6:32 AM

When it renders, it renders 1st frame of the animation ok. but it doesn't change to 2nd frame on the "2nd circle". so I get the same image even when it says it ought to be the 2nd, 3rd, etc image of the animation. So for the 8 frames of animation I got 32 images/directions x 8 frames, but they all showed the first image of the animation. I don't know if this makes it any clearer...?



Tiny ( ) posted Sun, 05 October 2003 at 8:02 AM

I was able to fix the -1 step render. In 'range(int(Steps-1.0)' I deleted the -1.0. and that did it. :o) I'm trying to figure out the frame range setting too... no luck so far. Is the frame range (number of frames of the animation) set at the line 'for F in range(scene.NumFrames()):' ?



ockham ( ) posted Sun, 05 October 2003 at 11:16 AM

Good catch! What it needs is scene.SetFrame(F) inside the loop. It's a fairly obvious error, and I should have caught that one. I corrected the script (including the -1) and re-uploaded. Same link, new content.

My python page
My ShareCG freebies


Tiny ( ) posted Sun, 05 October 2003 at 2:34 PM

:o) Great, thank you! Thanks to your script I understand more of how it works. Will try to learn as I go. But I'm sure I'll be back for more advice.



Tiny ( ) posted Mon, 06 October 2003 at 1:33 PM

Another thing I was able to do, thanks to you:

The program I use for programming the game imports series of .bmp files. the files must be numbered 001.bmp, 2.bmp, 3.bmp, and so on. So I experimented some and was able to solve it! jumps around feeling good about her self

Change this:
LastName = '_Frame%3d_Angle%3.2f.BMP' % (F,Step)

to this:
LastName = '_Angle%3.2f_Frame%3d.BMP' % (Step,F)


Ok, no big deal you may say...? Well for me it is a miracle when I get things to work, even small stuff. :o)

Is it ok if I share this script with other game making Poser users?



ockham ( ) posted Mon, 06 October 2003 at 6:34 PM

Certainly you can share! Python makes programming remarkably easy to learn. I wish it had been around when I was first getting into computers. Solving the real problem -- figuring out exactly what you want to do, and how to make it happen -- can still be very hard, but at least Python doesn't throw unnecessary difficulties in the way.

My python page
My ShareCG freebies


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.