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:04 AM

Quote - Whoo.  So I was right to use the clone() function when filling the points list in the complex example. I'm rather nervous, myself, about setting up funny reference loops and things, with all the RAM leak trouble I've had due to reference handling.  Cough.

Yes.

Quote - I'm a bit puzzled about how to interpret the hit distance.  It gives direction and the values are useful, relative to one another, to check good distances against bad.  It works that way for screening out the multi-actor collisions by distance.  But yesterday I tried to plug the abs() values for the distances into some code which needed the true distance from the collision point, and the values in the hit distances were nothing at all like the PointDistance values I ended up using.  How does one, ah, disassemble the hit distances to separate the direction vector component from the actual distance?  Or can that be done, given that we have a scalar here and not a vector?  I assume there's some modification by the direction of motion (our raycasting normal for the vertex) here....  Not that I need to get the values from the hit distances.  I can do point distance if need be.  It would be better, I assume, to use the existing values, though, if they can be used this way....

Sorry, I'm a bit puzzled by your question(s) :).  Ideally:
 
a = abs( hp.HitDist )
b = hp.HitDelta.length()
tmp = hp.HitPoint - origvert
c = tmp.length()

.... a == b == c  (though dealing with floating point, so they may be off by some small fractional amount).  Three different ways to determine the distance between the original vertex and the intersection point with the tripoly of the other mesh... the only functional difference is that hp.HitDist can be negative, so you have to wrap it in abs() to get the true distance.

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.