Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Dec 02 3:16 pm)
can it be used to read a list of poser files or scan the directories? << Yes, certainly. But beware: there is something odd about the file-handling mechanism in Python. If you get everything just right, it works fine; but it often gives an "attribute error" for reasons that I've never figured out. Also, the file handling actions go by default into the same directory where Poser.exe lives, not in the Runtime.
My python page
My ShareCG freebies
Just to get you started, here's an extremely simple example of writing to a file. The Python documents are woefully short on such examples. # ------------------------------# import os Somefile = open('poo.txt','w') for i in range(10): ~PooString = "Index " + str(i) +"n" ~Somefile.write(PooString) Somefile.close() # -----------------------------# This will create a file named poo.txt in the same directory with Poser.exe, and write ten lines in the file: Index 0 Index 1 Index 2 Index 3 Index 4 Index 5 Index 6 Index 7 Index 8 Index 9 To read a file, you'd start with Somefile = open('poo.txt','r') and the loop might look something like: for i in range(10): ~Newstring[i] = Somefile.read()
My python page
My ShareCG freebies
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.
yep I've been trying my hand at python at long last. I wrote a really simple script to load mike with a texture & hair then pose him. I know python is really good for manipulating the dials in poser, thanks bushi (faceshaper):) but can it be used to read a list of poser files or scan the directories? what I'm thinking is something like faceshaper but it has a lists of everything you have installed & allows you to pick say 1 character & texture, clothe & pose him with out having to do each step manually, just highlight the ones you want press a button & it runs a script in the background & it loads everything for you. Rob