Forum: Poser Python Scripting


Subject: Moving morphs between different figures

Cage opened this issue on Dec 20, 2006 · 1232 posts


Spanki posted Mon, 08 January 2007 at 2:50 PM

Cage,

If you want to try the method outlined above, you should find that it drastically simplifies the entire process.  You should be able to do a simple test-case shell code using your existing 'closest vertex' correlation code...

User specifies meshA and meshB
User specifies which actor has the morph in question
User specifies which morph to transfer
User moves the two figures around (use the BODY or hip) to line them up as near as possible in morphed area (but do not 'dial in' the morph in question, unless that happens to help line up the features)
User hits 'go' button

Script finds meshA
Script finds specified actor
Script finds specified morph
Script loops through morph deltas, building a min/max bounding box based on world-space values of verts in meshA that are involved in this morph (non-zero deltas)
Script adds fudge-factor to bounding box (some room around the edges).
Script loops through morph deltas again and...
for each non-zero deltaX/Y/Z
     find closest matching (world-space) vert on meshB (using bounding box above for screening)
     store deltaX/Y/Z from above as a delta for this vertex in meshB
create morph on meshB, using the data accumulated above

...done.  As you see, this becomes very much simplified - no normalizing of vertices, no dealing with lots of tables of stored correlation data, etc.  It's completely driven by the deltas that exist for any given morph and those same delta values are 'the answer' for the deltas to use on the other mesh as well.

Once you're satisfied that this is a viable approach, you should be able to 'plug in' new correlation methods as well as additional screening methods.

Cinema4D Plugins (Home of Riptide, Riptide Pro, Undertow, Morph Mill, KyamaSlide and I/Ogre plugins) Poser products Freelance Modelling, Poser Rigging, UV-mapping work for hire.