[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [46568] branches/meshdata_transfer/source/ blender/editors/object/object_vgroup.c: obs! not thinking straight.

Ove Murberg Henriksen sorayasilvermoon at hotmail.com
Sat May 12 05:50:51 CEST 2012


Revision: 46568
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=46568
Author:   cyborgmuppet
Date:     2012-05-12 03:50:44 +0000 (Sat, 12 May 2012)
Log Message:
-----------
obs! not thinking straight. Reverting bug from cleanup.

Modified Paths:
--------------
    branches/meshdata_transfer/source/blender/editors/object/object_vgroup.c

Modified: branches/meshdata_transfer/source/blender/editors/object/object_vgroup.c
===================================================================
--- branches/meshdata_transfer/source/blender/editors/object/object_vgroup.c	2012-05-12 03:32:13 UTC (rev 46567)
+++ branches/meshdata_transfer/source/blender/editors/object/object_vgroup.c	2012-05-12 03:50:44 UTC (rev 46568)
@@ -594,44 +594,44 @@
 					if(dist_v1 >= dist_v2 && dist_v1 >= dist_v3 && dist_v1 >= dist_v4){
 						tot_dist= dist_v4 + dist_v2 + dist_v3;
 						dw_src= defvert_verify_index(dv_array_src[mface_src[nearest.index].v4], index_src);
-						weight= dw_src->weight / tot_dist * dist_v4;
+						weight= dw_src->weight * (1-dist_v4/tot_dist);
 						dw_src= defvert_verify_index(dv_array_src[mface_src[nearest.index].v2], index_src);
-						weight+= dw_src->weight / tot_dist * dist_v2;
+						weight+= dw_src->weight * (1-dist_v2/tot_dist);
 						dw_src= defvert_verify_index(dv_array_src[mface_src[nearest.index].v3], index_src);
-						weight+= dw_src->weight / tot_dist * dist_v3;
+						weight+= dw_src->weight * (1-dist_v3/tot_dist);
 					}
 
 					/*exclude v2 and get weight from the 3 closest*/
 					else if(dist_v2 >= dist_v3 && dist_v2 >= dist_v4){
 						tot_dist= dist_v1 + dist_v4 + dist_v3;
 						dw_src= defvert_verify_index(dv_array_src[mface_src[nearest.index].v1], index_src);
-						weight= dw_src->weight / tot_dist * dist_v1;
+						weight= dw_src->weight * (1-dist_v1/tot_dist);
 						dw_src= defvert_verify_index(dv_array_src[mface_src[nearest.index].v4], index_src);
-						weight+= dw_src->weight / tot_dist * dist_v4;
+						weight+= dw_src->weight * (1-dist_v4/tot_dist);
 						dw_src= defvert_verify_index(dv_array_src[mface_src[nearest.index].v3], index_src);
-						weight+= dw_src->weight / tot_dist * dist_v3;
+						weight+= dw_src->weight * (1-dist_v3/tot_dist);
 					}
 
 					/*exclude v3 and get weight from the 3 closest*/
 					else if(dist_v3 >= dist_v4){
 						tot_dist= dist_v1 + dist_v2 + dist_v4;
 						dw_src= defvert_verify_index(dv_array_src[mface_src[nearest.index].v1], index_src);
-						weight= dw_src->weight / tot_dist * dist_v1;
+						weight= dw_src->weight * (1-dist_v1/tot_dist);
 						dw_src= defvert_verify_index(dv_array_src[mface_src[nearest.index].v2], index_src);
-						weight+= dw_src->weight / tot_dist * dist_v2;
+						weight+= dw_src->weight * (1-dist_v2/tot_dist);
 						dw_src= defvert_verify_index(dv_array_src[mface_src[nearest.index].v4], index_src);
-						weight+= dw_src->weight / tot_dist * dist_v4;
+						weight+= dw_src->weight * (1-dist_v4/tot_dist);
 					}
 
 					/*exclude v4 and get weight from the 3 closest*/
 					else{
 						tot_dist= dist_v1 + dist_v2 + dist_v3;
 						dw_src= defvert_verify_index(dv_array_src[mface_src[nearest.index].v1], index_src);
-						weight= dw_src->weight / tot_dist * dist_v1;
+						weight= dw_src->weight * (1-dist_v1/tot_dist);
 						dw_src= defvert_verify_index(dv_array_src[mface_src[nearest.index].v2], index_src);
-						weight+= dw_src->weight / tot_dist * dist_v2;
+						weight+= dw_src->weight * (1-dist_v2/tot_dist);
 						dw_src= defvert_verify_index(dv_array_src[mface_src[nearest.index].v3], index_src);
-						weight+= dw_src->weight / tot_dist * dist_v3;
+						weight+= dw_src->weight * (1-dist_v3/tot_dist);
 					}
 				}
 			}
@@ -641,11 +641,11 @@
 				tot_dist= dist_v1 + dist_v2 + dist_v3;
 
 				dw_src= defvert_verify_index(dv_array_src[mface_src[nearest.index].v1], index_src);
-				weight= dw_src->weight / tot_dist * dist_v1;
+				weight= dw_src->weight * (1-dist_v1/tot_dist);
 				dw_src= defvert_verify_index(dv_array_src[mface_src[nearest.index].v2], index_src);
-				weight+= dw_src->weight / tot_dist * dist_v2;
+				weight+= dw_src->weight * (1-dist_v2/tot_dist);
 				dw_src= defvert_verify_index(dv_array_src[mface_src[nearest.index].v3], index_src);
-				weight+= dw_src->weight / tot_dist * dist_v3;
+				weight+= dw_src->weight * (1-dist_v3/tot_dist);
 			}
 		}
 




More information about the Bf-blender-cvs mailing list