Sun, Oct 6, 6:47 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: Python Geometry?


Angelouscuitry ( ) posted Sun, 20 May 2007 at 1:31 AM · edited Wed, 24 July 2024 at 1:31 AM

Can python load vertexs, with order?


nruddock ( ) posted Sun, 20 May 2007 at 3:07 AM

Quote - Can python load vertexs, with order?

I'm pretty sure the answer is yes, but I'd need to know more about why you're asking to be sure.


PhilC ( ) posted Sun, 20 May 2007 at 3:36 AM

It can do a number of geometry functions. What are you wanting to do?


svdl ( ) posted Sun, 20 May 2007 at 6:19 AM

I think I know what you're trying to do. It might be possible to do it, but it won't be simple.
You're thinking about fixing the vertex orders on importing a morph target .OBJ that has its vertex order messed up by the 3D application, right? 
A workflow that MIGHT work - no guuarantees!

  • export the body part you want to morph from Poser and load it into your modeling app (or just load the .OBJ file from :runtime:geometries into your modeling app)
  • immediately export the loaded body part from your modeling app as .OBJ;
  • morph the body part in your modeling app;
  • export again.

If you're lucky, the modeling app messes up the vertex order on both exports IN THE SAME WAY. If that's the case, you can import the "original" .OBJ (the first export), have Python find the matching vertices, and create a translation table. Then import the morphed .OBJ, and have Python use the translation table to figure out what vertex in the imported. OBJ matches what vertex in the Poser original mesh. Move the vertex in the Poser original mesh to the position of the matching vertex in the imported .OBJ. Repeat for all vertices, and spawn morph target.

Again, this MIGHT work. There may very well be no consistency in how the 3D application messes up vertex orders, so there's no guarantee whatsoever.

The pen is mightier than the sword. But if you literally want to have some impact, use a typewriter

My gallery   My freestuff


Angelouscuitry ( ) posted Sun, 20 May 2007 at 3:12 PM

Poser Based Sky Dome - I would very much like to set up a Sky Dome thread/tutorial that would'nt need to import a good dome, and am trying to replace the Ball Hi-Res prop.  I'm wondering if a new sphere could be formed, such that the UV Mapping would be correct?


(196K)

To try and get rid of the Window(panes) artifact; in this scene, without an objects beside Ball Hi-Res props?


Cage ( ) posted Sun, 20 May 2007 at 4:02 PM

*"I'm wondering if a new sphere could be formed, such that the UV Mapping would be correct?"
*You can do this.  I have some scripts from TDMT lying around which can export/import geometry data using Poser's internal methods, including the UVs.  I never released it because I realized people could use the method to distribute geometry bootlegs via a .py/.pyc or mere text file.  :-P

The easiest way to do this would be to create your .obj and map it, then simply convert it to Poser geometry format, to be read in using a Python script.  The harder way would be to write something which would create a sphere, with UVs, algorithmically.  I'll bet Phil or svdl could help with pointers for the latter approach.  I assume that's what you really want...?

===========================sigline======================================================

Cage can be an opinionated jerk who posts without thinking.  He apologizes for this.  He's honestly not trying to be a turkeyhead.

Cage had some freebies, compatible with Poser 11 and below.  His Python scripts were saved at archive.org, along with the rest of the Morphography site, where they were hosted.


Angelouscuitry ( ) posted Sun, 20 May 2007 at 4:26 PM

Yes, Sir, Cage!  Thaks for replying!  

I'd hoped for your perpective, and thought you may have covered it!  

TDMT, is that the Figure to Figue Morph Transfer scipt?

So, what part of Forming a Sphere would be a risk?


Cage ( ) posted Sun, 20 May 2007 at 7:19 PM

*"TDMT, is that the Figure to Figue Morph Transfer scipt?

So, what part of Forming a Sphere would be a risk?"
*That Darn Morph Thing is the name Spanki and I decided on for the morph transfer script.  There are some functions in the UV and Geom modules which might point toward how to implement the Poser internal geometry methods.  I'll e-mail you the encodement script, if you want.  Just don't pirate meshes with it.  :-P

I'm not sure that any part would be a risk, unless you mean what I mentioned about distributing geometries.  A .obj file could be written out as a series of Numeric arrays and distributed in a .pyc file, to be reconstructed using PoserPython, if that's what you mean by risk.  If you're asking more about complications, for the algorithmic approach you'd have to write a function to create a sphere using Python (the easy part) and then also something to properly position the UV coordinates for the new geometry (I'm not sure how I would approach that).  Otherwise, I would just imagine encoding a .obj file as arrays and using Python to create it, but that would be going about things the hard way, for most purposes I could imagine. 

I'm not sure I've answered any of your questions, however....

===========================sigline======================================================

Cage can be an opinionated jerk who posts without thinking.  He apologizes for this.  He's honestly not trying to be a turkeyhead.

Cage had some freebies, compatible with Poser 11 and below.  His Python scripts were saved at archive.org, along with the rest of the Morphography site, where they were hosted.


Angelouscuitry ( ) posted Sun, 20 May 2007 at 7:47 PM

Well that's a Noble effort Cage, thank you for informing us! 

I'll not be able to position the UV coordinates, but hopefully someone may now?


PhilC ( ) posted Sun, 20 May 2007 at 8:02 PM

Yes some of my scripts include a custom OBJ import/exporter. Compiling an encrypted OBJ file as a PYC file is a method that I have used to give the same functionality as the RTEncoder.

But .......

I may be missing something here. Why not just import a correctly faceted, correctly UV mapped sphere?


Angelouscuitry ( ) posted Sun, 20 May 2007 at 8:36 PM · edited Sun, 20 May 2007 at 8:38 PM

:mellow: Importion.  I'd like to know this is something Poser can do out of the box.  If the numbers add up, in Python, I'd get kind of a fancy kick out of it; but learning Python, for modeling, is'nt on the list of reasons to care too much.  I'd just as soon go look for a especially proper import? :closedeyes:


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.