Cage opened this issue on Feb 24, 2010 · 592 posts
Spanki posted Tue, 30 March 2010 at 3:37 PM
Your new code above is just checking the MAX distance for zero - if the dists are always positive (non-negative values), then you should be checking the MIN distance, instead (and since the list is presumably already sorted, you'd really only need to test the first/closest one). Otherwise, you should check all of them (the code is attempting to divide by each one).
Once you run the above check, then you probably don't need to do the check on the total (although it doesn't hurt).
As for the difference... for all intents and purposes, the results "look" like (exactly the same as) what the other code was giving - I just didn't check the numbers (and the new code doesn't toss out a value, so that hack would have to be removed before a direct comparison of values could be done).
Relative to the ray-cast weight-generation code, the difference is worse, but no worse than the old code (I was thinking that once we got the weight code fixed, we might be able to use it for the ray-cast verts, but get_raycast_weights() does a much better job on those).
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.