Sun, Sep 22, 8:31 AM CDT

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: Camera & Figure rotation via Python? (for VR Worx's Quicktime VR software)


gellenburg ( ) posted Sat, 15 January 2005 at 9:44 AM · edited Sun, 22 September 2024 at 8:29 AM

::Sigh:: If only Poser included Perl support. ;-) I know absolutely nothing about Python, or even if the following is possible:

VR Worx is a Quicktime VR authoring studio that takes a series of images and makes a Quicktime VR movie out of them.

One of the features is an "object" Quicktime VR movie with a series of images as the "object" is rotated on a 360 axis (in 10 increments) around its X axis, and while the camera is moved from -180 to 180 (in 10 increments) from a point of origin.

Is anything like this even remotely possible to do in Poser with Python scripting? I've looked through the Python addendum that comes with Poser 5 but couldn't find anything specifically for controlling a figure's rotation along its X axis while at the same time controlling a camera through incremental steps.

Of course, I suppose the same effect could be achieved by simply rotating the figure along its X & Y axis and keeping the camera stationary.

Any help would be appreciated.

For God so loved the Walmart, that He gave His only begotten Son, that whosoever believeth in Him should not overpay, but have everlasting low, low prices. (John $3.88)


ockham ( ) posted Sat, 15 January 2005 at 11:50 AM

Very easy. Hold on a minute....

My python page
My ShareCG freebies


ockham ( ) posted Sat, 15 January 2005 at 12:03 PM

file_169999.jpg

Here's a supersimple implementation, with no interface or controls. It dumps the images in C:VR, so you need to have that directory available, or change the line...

My python page
My ShareCG freebies


ockham ( ) posted Sat, 15 January 2005 at 12:06 PM

If this is close to what you want, I can add an interface with choice of filename, choice of step, etc.

My python page
My ShareCG freebies


ockham ( ) posted Sat, 15 January 2005 at 12:07 PM

file_170001.jpg

The script itself is the attached text. Take the MESSAGE******.TXT and rename it to something.py like VR.PY before using.

My python page
My ShareCG freebies


gellenburg ( ) posted Sat, 15 January 2005 at 12:18 PM

Wow! Thanks.

I think so... maybe. ;-)

If you've ever seen a Quicktime VR movie, the object in the frame can be rotated, zoomed, etc. but to do this VR Worx needs 36 images (0 - 350, step 10) for each 10 of circumferal elevation (-180, -170, -160, ... 0, 10, 20, 30, etc.)

Typically, the object which a Quicktime VR movie is being made of is stationary, and the camera moves, and spins around the object taking pictures every 10 for each rotation and elevation.

Does that make sense?

I guess if I were to write it in pseudo code I might do:

for Y=-180 to 180 step 10

for X=0 to 350 step 10

rotate figure(X,Y)

save bitmap(IMG_X_Y)

next X

next Y

For God so loved the Walmart, that He gave His only begotten Son, that whosoever believeth in Him should not overpay, but have everlasting low, low prices. (John $3.88)


underdog ( ) posted Sat, 15 January 2005 at 12:20 PM

I am a perl coder and I would be interested in writing a CPAN implementation that would supply perl access to the python api. Is that worth pursuing? I would imagine it would be more work than I imagine, but I would love to have access to the ease of perl use and just use python for the api hooks. Perhaps there would be an initial python script that would exec a perl handler that could take over from there. Any thoughts or suggestions?


underdog ( ) posted Sat, 15 January 2005 at 12:23 PM

"..I would imagine that it would be more work than I imagine..." I really gotta proofread these a bit more. ;^)


ockham ( ) posted Sat, 15 January 2005 at 12:27 PM

file_170003.jpg

Oh, you want 36 x 36. Here's a variation to do that.

My python page
My ShareCG freebies


ockham ( ) posted Sat, 15 January 2005 at 12:31 PM

Attached Link: http://aspn.activestate.com/ASPN/CodeDoc/pyperl/Python-Object/Python.html

I'll bet $10 that something similar already exists... maybe an auto-translator? Perl and Python are cousins, and there are lots of folks who know Perl but not Python. See if this link gets you anywhere...........

My python page
My ShareCG freebies


gellenburg ( ) posted Sat, 15 January 2005 at 12:37 PM

Ockham, thank you so very much. I think that will work perfectly.

For God so loved the Walmart, that He gave His only begotten Son, that whosoever believeth in Him should not overpay, but have everlasting low, low prices. (John $3.88)


underdog ( ) posted Sat, 15 January 2005 at 1:12 PM

Thanks, Ockham, I waded around on the activestate site a bit, and I am not sure where to go with that library, although it does look promising. Maybe I am taking too simplistic an approach to this. What I envision is that Poser calls a python script and that the python script has the poser library imported, knows about the active figure, actor, camera, etc. It knows how to manipulate the poser API. What I want to do is call a Perl script from that python script, and say, "Hey, here I am. Go do whatever it is you are supposed to do (read data, get keyboard input, etc). If you need to find out the currently selected poser figure, or set a camera position, etc, call me using this method and supply these positional parameters and I will contact Poser on your behalf, massage the data so it is the right datatype, and then return a handle to the figure, or adjust the camera, etc." I am going to go investigate sockets in python and see how hard it will be to get some conversation going between a perl script (client) and a poser python script (server).


mkrueger ( ) posted Sat, 15 January 2005 at 1:37 PM

If I remember correctly, there was a discussion about this here. Yep, just found it: http://www.renderosity.com/messages.ez?ForumID=12390&Form.ShowMessage=2071612 trobbins2 works on such a server. The Sockets-stuff shouldn't be hard to implement, but you have to design a protocol to communicate between client and server first. martin


underdog ( ) posted Sat, 15 January 2005 at 1:43 PM

Thanks, mkrueger. I am checking that thread out now..


mkrueger ( ) posted Sat, 15 January 2005 at 2:48 PM

You're welcome, keep us posted on your progress! martin


an0malaus ( ) posted Sun, 16 January 2005 at 12:23 AM

[eyeball of thread]



My ShareCG Stuff

Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.


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.