Thu, Nov 14, 3:15 PM 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 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: Question about..well..python and poser;)


Dana_CH_AZ ( ) posted Sun, 27 March 2005 at 2:14 PM · edited Thu, 14 November 2024 at 3:14 PM

Ok, just wondering if this is possible: A gui toolkit to put dynamic control settings into cloth room so say you want to have sheets act like cotton, instead of typing out numbers from www.poserfashion.net, you just click a button, and it is done. Now, I was advise on how it can be done, and it is cool..but what I also want to be able to do is select which cloth prop to do it..for instance, if I have 4 simulations open, and I want to make the third one cloth..I want to be able to select it somehow, whether by typing in the name or something. I hope I explained it properly.:) ANYWAYS, I tried all my might, but I am afraid I don't understand python well enough to do much without blowing up my computer;)


nruddock ( ) posted Sun, 27 March 2005 at 4:02 PM

Glad to see you made it over here.
I'll make a stab at this as I don't know whether ockham has P6 yet.

The most important thing I need to know is whether your using a PC or a Mac.

If your on a PC, I should be able to do a GUI of some sort for this, otherwise it will have to be a set of scripts that just apply a particular group of settings to the current simulation (at least to start off with as there may be a way around the Mac GUI problems).

I'll post the script here when I have one.


Dana_CH_AZ ( ) posted Sun, 27 March 2005 at 4:29 PM

Attached Link: http://www.poserfashion.net/cloth_parameters.htm

oh, I am sorry...I am using Windows.;) (as opposed to linux..when p6 ports over or a wine is made, then maybe..) I am attaching a link to the clothing parameters..the ones I commonly use is the libraries, cause the default matches the poser cloth room more. What I want to be able to do is select a simulation, and click on a radio/button/something and the settings will go to what cotton is, or whatever cloth settings. I think it would be useful for people who use the cloth room, but have no idea what the base foundation should be for cloth type..sure the manual said the last I looked (haven't read p6 manual yet) that silk has a less bend resistence then wool..well, yea I can see that, but what general range should it be? If I am asking that, a lot of others would. The numbers aren't exact (careful wit hthe density), but it provides a basis for tweaking.;)


nruddock ( ) posted Sun, 27 March 2005 at 4:42 PM

I'll make sure to make it easy for you (or anyone else) to adjust the presets (or add new ones).

I'm going to try for a dialog that has a list of cloth simulations (you pick which ones to apply values to), entry boxes for the numbers, a set of preset buttons, and an apply button.

My biggest gripe about the Cloth Room would be that the parameters don't seem to have (any) units that can be related to the RealWorld, which means that I only have the visual result to go on when trying to simulate a particular type of cloth.


Dana_CH_AZ ( ) posted Sun, 27 March 2005 at 4:56 PM

Actually, that pretty much everyone who uses cloth room, and admittedly mine as well gripe. The problem is, without kicking CL too much in the balls, is that they implemented cloth room settings into poser without wondering if it was the most inituiative way to do it..I still won't use the dyn.hair cause I don't like the looks of them. The strands are nice and all, but transmap looks better for one reason or another. Getting them to collide? ARGH.;) And cool..I understand based on your explaination of where the setting should go, and such points as that..just getting them to work in a practical poser clothed environment was causing me to talk to myself;)


nruddock ( ) posted Sun, 27 March 2005 at 11:45 PM

file_209671.png

This is the dialog.

When you run the script the list box will show all current Cloth Simulations, adn you can select any combination of them.

Clicking the "From Sim" button will get the settings from the last simulation you selected.

Clicking Default will restore the values to the Cloth Room defaults.

If you look in the script you will see how to setup values for the Presets, and how to add others (the script will make buttons automatically for any Preset defined).

All values below Air Damping and not available from the Cloth Room screen and there effect can only be inferred from the names.

Click the Apply button to alter the settings for all selected simulations.

Click the Quit button to quit :)

The script will not notice changes in the number of simulations, so if you add or remove simulations you should rerun the script.

I may add the ability to load and save presets later.


nruddock ( ) posted Mon, 28 March 2005 at 12:05 AM · edited Mon, 28 March 2005 at 12:06 AM

file_209673.png

Here's the script. Code is released under GPL, see top of script for details.

All the button and label text is defined at the beginning of the script if you wish to change them from English to some other language.

Right click on the link and Save As ...
Change the name to (say) ClothSimSetter.py and select directory of your choice.

You can run it from the File menu or assign to a Script button.

Message edited on: 03/28/2005 00:06


Dana_CH_AZ ( ) posted Mon, 28 March 2005 at 4:37 AM

file_209675.png

Thanks;) Here is the script again but with the presets in them.;)


nruddock ( ) posted Mon, 28 March 2005 at 10:38 AM

Can somebody with a Mac and P6 try this out and let me know if it works.

If is doesn't I'll turn it into a set of non-GUI scripts or use it as an excuse to delve into the non-Tkinter dialogs.


msg24_7 ( ) posted Tue, 29 March 2005 at 2:46 PM · edited Tue, 29 March 2005 at 2:49 PM

Tried and failed on a Mac (OSX 10.3)...

Traceback (most recent call last):
File "", line 295, in ?
File "Macintosh HD:Applications:Poser 6:Runtime:Python:Lib:lib-tk:Tkinter.py", line 35, in ?
import _tkinter # If this fails your Python may not be configured for Tk
ImportError: No module named _tkinter

Of course it may be, that I'am missing something about running python scripts on a Mac ;-) I did it the way I'd do it on a PC.

Message edited on: 03/29/2005 14:49

Yesterday's the past, tomorrow's the future, but today is a gift. That's why it's called the present.


duckmango ( ) posted Tue, 29 March 2005 at 3:55 PM

I pulled this off a thread in the Mac forum, discussing P6. It's from a readme file: "TKinter, a UI toolkit commonly used by Python developers is not available on Mac OS X for the version of Python Poser uses. Instead, Curious Labs has partially exposed the Poser UI to Python. Please see the PoserPython Methods Manual, the Wacro folder and scripts such as ExportFlashFiles.py or uncompressPoserFiles.py for reference)." Anyway, look forward to playing with this dynamic cloth script, once my P6 arrives....


nruddock ( ) posted Tue, 29 March 2005 at 4:08 PM

This confirms that there isn't Tkinter support in the Mac version.
Not unexpected, but I'd no way of finding out, other than having someone try.
I'll see what I can do with alternate Dialog support.


mmogul ( ) posted Wed, 30 March 2005 at 6:39 PM

_ ?) ~ bookmarked...


BastBlack ( ) posted Fri, 21 October 2005 at 8:53 PM

Any luck getting this little gem to work in Mac P6 yet? Thanks. bB


PhilC ( ) posted Sat, 29 October 2005 at 12:22 PM

Attached Link: http://www.philc.net/freestuff.htm

file_209676.png

This one got me thinking, so I came up with the above. Not to say that one is better than another, I primarily enjoyed the exercise. Also Kamilche has done something similar in her Cloth Room Helper. Both scripts are on the freestuff page.

As they say there are more ways to skin a cat. :)

philc_agatha_white_on_black.jpg


BastBlack ( ) posted Sat, 29 October 2005 at 3:16 PM

Sweet! Does it work in the Mac P6 (and P5 too)? bB


PhilC ( ) posted Sat, 29 October 2005 at 3:49 PM

P6 Mac, yes P5 no. (I need to put that on the page, thanks).

philc_agatha_white_on_black.jpg


dorkati ( ) posted Sun, 30 October 2005 at 11:28 AM

Links for zip files don't work :(


PhilC ( ) posted Sun, 30 October 2005 at 11:55 AM

May be server load. I can email it to you if required. pcooke@philc.net

philc_agatha_white_on_black.jpg


dorkati ( ) posted Sun, 30 October 2005 at 11:57 AM

Oh, yes Phil...it would be great...I like all of 4 scripts :) Thanks :)


bigjobbie ( ) posted Mon, 31 October 2005 at 6:04 AM

Thanks Guys, help with the Cloth Room is always welcome! Cheers


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.