Forum: Poser - OFFICIAL


Subject: Morph Cleanup Script

Cage opened this issue on Feb 24, 2010 · 592 posts


Spanki posted Tue, 30 March 2010 at 3:17 PM

Yep, that seems to give roughly (if not exactly) the same answer as before.  A little re-arranging of the terms comes up with this:

def get_weights2(dists):<br></br>
    total = 0.0<br></br>
    result = [0.0 for i in dists]<br></br>
    for di in range(len(dists)):<br></br>
        result[di] = 1.0 /
dists[di]<br></br>
        total += result[di]<br></br>
    for i in range(len(result)):<br></br>
        result[i] = result[i] /
total<br></br>
    return result<br></br>

...although it's not too likely, I think I'd add back some divide-by-zero checking (at least on the original dists[] list).

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.