Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Dec 02 3:16 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
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
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!
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
Attached Link: http://ockhamsbungalow.com/Python/CamCircle.zip
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
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)
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
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...?
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
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?
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
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.
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.)