Forum: Poser Python Scripting


Subject: Moving morphs between different figures

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


Spanki posted Tue, 25 March 2008 at 12:43 AM

No problem... going over it many times helps me understand what's happening as well :).

Spanki's psuedo-no-poke-code-snippet:

if hp.HitDist < 0.0:<br></br>
    if abs( hp.HitDist ) < fit_tolerance:<br></br>
       
move_vert_out_along_its_normal( fit_tolerance - abs( hp.HitDist )
)<br></br>
else:<br></br>
    move_vert_out_along_its_normal( hp.HitDist
+ fit_tolerance )<br></br>

...if it's negative, then it's not poking, but it might be very close, so we make sure it's at least 'fit_tolerance' distance away.  If it's positive, then it's inside the other mesh (skin poking through), so we have to push it out by that much, plus the fit_tolerance (offset).

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.