Tue, Feb 18, 3:43 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: 2025 Feb 05 6:41 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: Utility of script for adding morphs


DigiCalimero ( ) posted Tue, 19 April 2005 at 6:40 AM · edited Sat, 08 February 2025 at 5:51 PM

I am wondering if anyone knows of an utility or script that lets you add a lot of morphs to a figure or prop? I was thinking it would look in a folder for obj's and then add all those as morphs to a prop and name the morphs by the filename. Do you think such a thing could even be done with Python?


an0malaus ( ) posted Tue, 19 April 2005 at 7:18 AM

I can't see any problem with the concept. There are certainly code samples to select a directory and files. Python can certainly load morph targets on any actor (prop or figure body part). How different do you need this to be from the morph injection concept. There are also ways to use a wrapper or loader .CR2 file to add morphs whose channels don't already exist (as morph injection typically requires) to a figure being loaded (via readscript) into a scene (not for already loaded figures though). On the utility front, I believe MorphManager and its clones can transfer morphs from one figure to another of the same base type. Is this what you're looking for or do they have to be morphs saved out to OBJ files?



My ShareCG Stuff

Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.


DigiCalimero ( ) posted Tue, 19 April 2005 at 9:09 AM · edited Tue, 19 April 2005 at 9:12 AM

Well I made a new figure and I need to add a bunch of morphs to it, which is tedious and boring doing it manually from Load Morph Target..loading, naming.... :)

I was hoping such a utility or script exists. Seems it would benefit everybody who works with figures. Adding 10-15 morphs to a figure is OK, but when you have like 100......

Could you point me to some python resources that show you how to load a morph target to a prop?

Message edited on: 04/19/2005 09:12


nruddock ( ) posted Tue, 19 April 2005 at 1:01 PM

Most of the work will be in parsing the .OBJ files that contain the morphs, and working out from the names of those files what the morph name and body part should be.

Once you have the geometry object created and you know the actor ceating the morph target is one line

actorObject.SpawnTargetFromGeometry(geometryObject, "MorphName")

A good solution would be to use a control file with a line for each morph with the necessary information i.e.

MorphName1 BodyPart1 xyz.obj
MorphName2 BodyPart1 abc.obj
MorphName1 BodyPart2 jkl.obj
etc.


DigiCalimero ( ) posted Tue, 19 April 2005 at 1:17 PM

Thanks for the reply, I think I understand :) Practically speaking, how do I tell the script what the geometryObject is? I am familiar with programming concepts, but I've never touched Python. I guess I have some reading to do :) What is a good resource for Poser related Python?


nruddock ( ) posted Tue, 19 April 2005 at 2:06 PM

Most of what you need is standard Python.

File and filename handling [os and os.path modules].
A loop to read each line of the control file then calls a subroutine which read an OBJ and creates the morph in the specified body part on the current figure [lists and for loop].

As you need only the "v" lines in the OBJ then you can simplify the processing [reading from a file and spliting strings].

One of the scripts that comes with Poser [geom_genmesh.py] will show how to create the necessary geometry, again your only interested in the vertices.

The best references for Poser Python are
a) The sample scripts.
b) Scripts by ockham and others.
The PoserPython manual tells you what methods exist and their parameter types.

For everything else, download the standard Python 2.2 documentation (link in forum header).


DigiCalimero ( ) posted Tue, 19 April 2005 at 2:15 PM

Ok, I'm off to study! Thanks :)


nruddock ( ) posted Tue, 19 April 2005 at 3:40 PM

Feel free to ask questions if you get stuck.


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.