Forum: Poser Python Scripting


Subject: Positioning hair room hairs

Cage opened this issue on Apr 08, 2007 · 17 posts


Cage posted Fri, 13 April 2007 at 12:55 AM

Here's the in-progress GUI version.  It has the two versions of tube-pose rotation shown above, as well as straightening, lengthening, translation, scaling, and smoothing of hairs.  Hairs can be selected by group, then by polygon (each hair is a poly), then by vertices, allowing some flexibility in applying shape changes.  Shapes can be altered by "baking" the hair mesh, or they can be added as morphs so they can be combined for a final shape or deleted.  There is a function to bake the morphed shape to the mesh.  Custom poses can be saved and loaded for the hair tube, so that positions can be easily saved and recreated.

The gui still needs a bit of work.  Right now it's confusing, with most functions hidden away in the file menu.  There is an incomplete version of tube posing which uses rotation matrices.  It isn't working yet.  

For the time being, the main rotation function is a bit of a kludge, but it seems to work.  Triangle props are created along the hairs and these actors are rotated to match the pose of the hair tube, so we can use the rotated tris to apply the correct location for the hair verts.  Creation and deletion of the tris can be slow if you're working with a large hair group.

The "straighten along group normals" and "translate along group normals" functions both use the normals of the polys in the hair group of the parent object from which the hair prop was generated, in the hair room.  If the parent prop lacks a group with the same name as the hair prop, the normals functions won't work.

The hair prop selection listbox looks for props with a parameter dial named "Dynamics" to decide what to display, right now.  So it is possible to fool the script into selecting the wrong type of prop if a dial with that name is present in, for instance, a cloth prop in the scene.

So far so good, hopefully.  I hope to add actual matrix math for the vertex rotations.  It occurs to me that what's being done here is really a sort of low-grade skeletal deformation.  The basic process, if the matrix rotations can be figured out, could perhaps be used to import a Blender figure or a .md5 model and pose it within Poser (applying the vertex weights), using a skeletal rig made of props.  At the very least, perhaps a new sort of deformer system could be developed from this.

===========================sigline======================================================

Cage can be an opinionated jerk who posts without thinking.  He apologizes for this.  He's honestly not trying to be a turkeyhead.

Cage had some freebies, compatible with Poser 11 and below.  His Python scripts were saved at archive.org, along with the rest of the Morphography site, where they were hosted.