Forum: Poser Python Scripting


Subject: Moving morphs between different figures

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


Cage posted Thu, 06 March 2008 at 2:17 PM

I'm not sure about a diagram.  Umm.  I'll try a description, first.  I've tested this for shape reconstruction after a shrinkwrap run, and we can properly position a vertex using weights gained from neighbors as I've described.

In terms of my current application, a neighbor vertex is any vertex which shares a polygon with the current vertex.  That's all the vertices in the pverts listing for any vert, excluding the vert itself.  The weights describe the "influence" of the neighbors to the vertex, based on distance.  This is used to restore some of the mesh "integrity" (basic relationships between vertices) after a shrinkwrap, which helps correct areas where we've had a great deal of stretching.  (In this case it also shrinks us.)  It basically restores the vertex relationships in the context of the new shape.  it could be used to smooth a morph using another morph as input, for instance, or using the base shape.  Possibly a good way to counter the "lumpy" morphs.

Clear as mud, right?  For the nearest vertex application, I'd still need to cast a line to find a point on the correlating mesh, presumably.  Then create a bounding box around that point and locate the set of closest vertices.  Then weight them based on distance.  The trouble would be that we'd get arbitrary correlations and introduce potential noise into the reshaping, because we don't know that "closest" verts in this case really should have any influence on the collision point.  This would work better if we had a structural constraint, such as polygon relationships - which we do have with point in tri.  I don't think the nearest vertex idea would be very effective.

My main question should be whether neighbor weights could be used within the context of the located triangle.  Would the weighting I'm using be equivalent to the triangle edge weighting currently in use, or would my process involve some sort of averaging error or something?  I guess I should test this and post the testing code, lacking a concise and descriptive diagram....

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