Tue, Jan 7, 11:17 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: Making clothes fit


rodney ( ) posted Sun, 09 September 2001 at 4:16 AM · edited Mon, 06 January 2025 at 7:10 AM

I took as my 'learn Python' exercise the writing of a Python script that would go through a figure and interpolate all MT's on the Figure to the clothes that figure is wearing. Leaving aside all obvious shortcomings of such a script (like the fact that clothing tends to actually cover body parts that they aren't named for, like the chest of a shirt covering the collar), I was actually able to get the script working for some clothes (you should see Ironbear's Aolanni in the 'stretched to fit' P4 bikini). My problem is as follows. My 'learn python' exercise is now over, I know the language pretty well, but now I'm plagued with getting this script to accurately interpolate morphs. It currently works fine on things like bikini's since these items tend to be fairly close fitting that start out shaped similar to the figures body. But for looser fitting clothes, my algorithm tends to force them to look like close fitting clothes (kinda like a wet T-Shirt contest :) If anyone is willing to take a look at a bunch of poorly written Python Script and help me complete this I would sincerely appreciate it. Oh, I intentionally left out any description of what I did in hopes that it may spark up a bit of tech talk about ways to accomplish this. I'm sure my way is 'a way', just not 'the way'. If anyone is really interested I'd be happy to post both the script as well as an explanation of what I did (it's not really complex).


jbrugion ( ) posted Sun, 09 September 2001 at 6:00 PM

Attached Link: http://home.earthlink.net/~redink3d/V2ClothingPack1.html

Been there and done that (see the attached link). For obvious reasons I am relunctant to give full details of what my code uses at this time as I am trying to turn it into a marketable product. For what it's worth: There are multiple ways to skin this cat. The easiest way is to search for closest vertex matches on the figure and clothing. It has some drawbacks, one of which you may have hit. To get realistic looking items, as well as complex issues like skirts, the problem gets nastier. To turn it all into a relatively turn key operation I've had to crank about 7140 lines of code (LOC) or about 2400 effective lines of code (eLoc) for my core processing classes. Most of that has been necessary to handle various pathological cases. One nasty example is belts and other items getting distorted by the morphs. One of my post processing tasks involved going back through and getting the belts back to a semi-normal appearance. Another issue is that most of the clothing makers tend to try and go with lower numbers of polygons on the clothing than whats on the figure. This can lead to issues ranging from simple cracking to some pretty big distortions.


rodney ( ) posted Sun, 09 September 2001 at 6:23 PM

hehe...actually your website is one that I came across before. Being a programmer (and nosey as heck), I HAD to try it myself to see what problems were involved. I planned on buying the clothing pack update (have to in order to make anything with Vicki that has clothing, since I usually don't like her 'standard' appearance)... But knowing that the problems I ran into are most likely 'standard' problems with the issue is somewhat reassuring (unless we used the same technique)... The only other thing I learned about this process is that I really need to look more into Pythons ability to accept 'classes' from other languages. I'd imagine that you've been down that path since you are looking into reselling your scripts, it would be the only way to not 'tell' all customers how you did what you did.


jbrugion ( ) posted Sun, 09 September 2001 at 10:42 PM

Actually, was looking at eventually distributing *.pyc files along with header descriptions. I had originally hoped to have it work as a simple dialog app where the code would do everything. Should have known better. Now looking at a set of toolkit classes and apps that automates it as much as possible but there will have to be an human in the loop at some point. Since the end goal is artistic, vice purely mathematical, there is almost a need for human intervention for it to "look good". My current code is pure Python. I spent a lot of time, and a few dead end traversals, trying to get the code to run as quickly as possible under Python with no compiled native C/C++ code. Part of that was pure laziness, not wanting to have to deal with an extension dll setup and compile. As far as the problems go, almost all the techniques that are available will work well on the "field" verts/polys. The ugliness sets in, as with all computational problems, at the boundaries, interfaces and sharp corners. I played with several techniques and all of them look good on the middle of the forearm or on the middle of the gut. Where the fun starts is at the elbows, breasts, buttocks, shoulder and other complex parts. Spent a couple of months tweaking that one up. I don't mean to discourage you. By all means keep trying, you might just find a quick easier way of working this problem than I did. As you said, there is no one way to solve this problem.


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.