Fri, Jan 10, 5:00 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: Poser Export to Rise


sama1 ( ) posted Wed, 03 August 2005 at 6:32 AM · edited Fri, 10 January 2025 at 12:10 AM

Attached Link: http://rise.sourceforge.net/cgi-bin/makepage.cgi?Home

I need help in writing a script to export Rise. What I am trying to do is write out the geometry of a model in Poser to the Rise format.

http://rise.sourceforge.net/

The Rise format starts with the letters "TRI" if the geometry is a triangle and "QUAD" if the geometry is a square.

The problem I am have is more of a Python question where I can print out a line at a time for each of the X,Y,Z coordinates. What I want to do is print them all out on one line.

Any help would be appreciated.

My main goal is to get a Poser character into Rise and find out if texturing works. If not textured, find out if I can use the techniques of Henrik Jensen's photonmap to add more realism to a character.

Thanks,
Sam


nruddock ( ) posted Wed, 03 August 2005 at 1:12 PM

The Python trick your looking for to get things on the same line, is to have a "," at the end of the print statement.

Assuming you've managed to get to the point where you have a Geometry object (if not just say so), you want something like this :-

verts = geom.Vertices()<br></br>sets = geom.Sets()<br></br>polys = geom.Polygons()<br></br>for poly in polys:<br></br>    start = poly.Start()<br></br>    numv = poly.NumVertices()<br></br>    if numv == 3:<br></br>        print "TRI",<br></br>    elif numv == 4:<br></br>        print "QUAD",<br></br>    else:<br></br>        print "HELP",<br></br>    for idx in range(start, start + numv):<br></br>        vert = verts[sets[idx]]<br></br>        print vert.X(), vert.Y(), vert.Z(),


sama1 ( ) posted Thu, 04 August 2005 at 6:48 AM

Thanks for the pointer. I would never have thought of putting a comma at the end.


nruddock ( ) posted Thu, 04 August 2005 at 2:52 PM

It's mentioned in the Python documentation for the print statement.


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.