Forum: Poser Python Scripting


Subject: Moving morphs between different figures

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


Spanki posted Fri, 12 January 2007 at 8:30 PM

Yes, line-box intersection checks.  Unfortunately, I don't have the code to do that (i'd have to look it up and/or think about it more), but maybe someone else will pipe up with that.

Just to clarify something... expanding the regions for the polygon tests would help in a lot of cases (those vertices/polygons that fall right on the border would end up in both regions, instead of just ones side or the other).  And it could even catch 90+% of the other cases if the overlap is large enough and if the mesh polygons are fairly consistent in size/shape.

As for expanding the region, hell, I'd just pass some fudge value into the routine when it's sorting the vertices into regions. Then your test becomes:

if( vertX <= (boxMaxX + fudge) and vertX >= (boxMinX - fudge) )

...etc.  No need to do scaling before-hand.  So you pass a fudge factor into the routine that's categorizing the vertices of the source mesh (the ones that make up the polygons that you're going to test against) and don't pass any fudge factor (or 0.0) in when you're categorizing the target mesh verts.

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.