Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 am)
Ok, I've tried both demos, and I think they're just terrific. Very impressive -- well done, and thanks for posting the code.
Here's a couple of quickie comments:
PP generates a syntax error with += statements. Demos work fine in P5, as well as in standalone python.
One pose file to generate many partial poses...yes, I can see the utility in that. Are you also thinking of extending this to character files, e.g., parse a character file into Mat poses? JCM poses?
(sigh...could've used something like this a month ago...)
So let's see if I'm following the code correctly: If I want to, for instance, just count the number of times 'targetGeom' occurs in a pose file, I would create a linked list (actor->channel->parameter) plus associate a counting routine for the 'dosomethingimportant' method in the parameter node, right?
Here is an example for materials. It's using a function to pick only the Torso and Head materials
def pickonlysome(rtn):
if rtn['materials'][0] in ( 'SkinTorso', 'SkinHead' ):
return 1
return 0
reMAT = re.compile( r'bmaterials+(.+)b', re.IGNORECASE )
reValue = re.compile( r'(.+)', re.IGNORECASE )
Materials= ParmList( 'value', reValue, dosomethingimportant )
Materials.newparent( 'materials', reMAT, pickonlysome )
# Pass the linked list to the class and let it rip.
junk = ParmExecuter( inStr, Materials )
Searching a big cr2 file takes some time. The above example took 25 seconds for a 41MB file.
Wow, this is cool stuff! [Bookmark]
Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.
I am not sure what this is about. Can someone please fill me in? Is this about CR2 on the fly with PZ2 as a backend? Tromnek, I still wonder how you were able to write code in PY. Now you just said you need Python.DLL from Poser PP. Would you please tell us how you were able to get external DLL to work with standalone Python. Thanks
These classes assist in parsing poser files (probably any type) so that you can find specific parameters and values, then execute a user defined function each time they are found in a file.
Since it is very generic, they can be used in a variety of situations. Currently, I'm using them to filter a pose file (.pz2) so that my user defined function can set rotation and translation parameters on only selected body parts in a figure.
I'll start another thread to try and address your other more generic poser-python question.
Message edited on: 01/09/2005 12:08
These classes are very basic and only locate parameters in a poser file and give your script an opportunity to do what ever you wish with that parameter. I'll clean up the script that I'm currently using to filter .pz2 files and post it later this week. Maybe a real example will help illustrate their use.
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.