Forum: Poser Python Scripting


Subject: Moving morphs between different figures

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


Cage posted Sat, 23 December 2006 at 1:10 AM

If any of the Python wizards are listening, I'm encountering a puzzling error, with which I need at least a logic check, hopefully advice.

When I apply the conversion morph target, I am taking the original morph deltas plus the difference between the 'target' actor's coordinates and the 'source' actor's coordinates.  This creates a morph which then needs to have the same difference subtracted.  Initially, I created a 'difference' morph and set it to negative1.  So I adjusted the code to try to integrate that difference morph.  (see below.)

        a = geom2.Vertex(int(i)) #source
        b = geom1.Vertex(matched) #target
        #adjust the morph delta by the difference between the two source meshes
        diff = (b.X()-a.X(),b.Y()-a.Y(),b.Z()-a.Z())       
        deltaX = (mt[0] + diff[0]) - (b.X()-a.X())
        deltaY = (mt[1] + diff[1]) - (b.Y()-a.Y())
        deltaZ = (mt[2] + diff[2]) - (b.Z()-a.Z())   

And that seems to work... some of the time.  I've favored running tests from V1 to V3.  This code works for that situation.  Going the other way, it causes problems.  The above is what I've had posted in these scripts.  But I had actually intended to subtract (a-b) coords from the (mt+diff) portion.

Umm.  So, my question: what the bloody heck is the math representing a morph dial set to negative1?  I can't seem to get the results to turn out consistently right without going back to adding the compensatory dial and setting it to negative.  There has to be a mathematical expression for this....  I assume I'm just mixed up about the proper formula.

See, I'm really not so bright.  :)  Don't get to hyped up about this, folks.  Cage is struggling with simple things.  😊

===========================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.