Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2025 Feb 05 6:41 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?
Verbosity: Profusely promulgating Graham's number epics of complete and utter verbiage by the metric monkey barrel.
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
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.
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).
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.
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?