[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48094] branches/meshdata_transfer/source/ blender/editors/object/object_vgroup.c: clenaup.
Ove Murberg Henriksen
sorayasilvermoon at hotmail.com
Tue Jun 19 20:27:03 CEST 2012
Revision: 48094
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48094
Author: cyborgmuppet
Date: 2012-06-19 18:26:55 +0000 (Tue, 19 Jun 2012)
Log Message:
-----------
clenaup.
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-06-19 18:07:13 UTC (rev 48093)
+++ branches/meshdata_transfer/source/blender/editors/object/object_vgroup.c 2012-06-19 18:26:55 UTC (rev 48094)
@@ -581,32 +581,21 @@
index_nearest = nearest.index;
/* project onto face */
- normal_tri_v3(normal,
- mv_src[mface_src[nearest.index].v1].co,
- mv_src[mface_src[index_nearest].v2].co,
- mv_src[mface_src[index_nearest].v3].co);
+ mf = &mface_src[index_nearest];
+ normal_tri_v3(normal, mv_src[mf->v1].co, mv_src[mf->v2].co, mv_src[mf->v3].co);
+ project_v3_plane(tmp_co, normal, mv_src[mf->v1].co);
- project_v3_plane(tmp_co, normal, mv_src[mface_src[index_nearest].v1].co);
-
/* interpolate weights over face*/
- if (&mface_src[index_nearest].v4 != NULL) {
- interp_weights_face_v3(tmp_weight,
- mv_src[mface_src[index_nearest].v1].co,
- mv_src[mface_src[index_nearest].v2].co,
- mv_src[mface_src[index_nearest].v3].co,
- mv_src[mface_src[index_nearest].v4].co, tmp_co);
+ f_index = mf->v4 ? 3 : 2;
+ if (f_index == 3) {
+ interp_weights_face_v3(tmp_weight, mv_src[mf->v1].co, mv_src[mf->v2].co, mv_src[mf->v3].co, mv_src[mf->v4].co, tmp_co);
}
else {
- interp_weights_face_v3(tmp_weight,
- mv_src[mface_src[index_nearest].v1].co,
- mv_src[mface_src[index_nearest].v2].co,
- mv_src[mface_src[index_nearest].v3].co, NULL, tmp_co);
+ interp_weights_face_v3(tmp_weight, mv_src[mf->v1].co, mv_src[mf->v2].co, mv_src[mf->v3].co, NULL, tmp_co);
}
/* get weights from face*/
weight = 0;
- mf = &mface_src[index_nearest];
- f_index = mf->v4 ? 3 : 2;
do {
v_index = (&mf->v1)[f_index];
weight += tmp_weight[f_index] * defvert_find_weight(dv_array_src[v_index], index_src);
@@ -648,16 +637,16 @@
index_nearest = nearest.index;
/* get distances */
- dist_v1 = len_squared_v3v3(tmp_co, mv_src[mface_src[index_nearest].v1].co);
- dist_v2 = len_squared_v3v3(tmp_co, mv_src[mface_src[index_nearest].v2].co);
- dist_v3 = len_squared_v3v3(tmp_co, mv_src[mface_src[index_nearest].v3].co);
+ mf = &mface_src[index_nearest];
+ dist_v1 = len_squared_v3v3(tmp_co, mv_src[mf->v1].co);
+ dist_v2 = len_squared_v3v3(tmp_co, mv_src[mf->v2].co);
+ dist_v3 = len_squared_v3v3(tmp_co, mv_src[mf->v3].co);
/* get closest vertex */
- if (dist_v1 < dist_v2 && dist_v1 < dist_v3) index_nearest_vertex = mface_src[index_nearest].v1;
- else if (dist_v2 < dist_v3) index_nearest_vertex = mface_src[index_nearest].v2;
- else index_nearest_vertex = mface_src[index_nearest].v3;
- mf = &mface_src[index_nearest];
f_index = mf->v4 ? 3 : 2;
+ if (dist_v1 < dist_v2 && dist_v1 < dist_v3) index_nearest_vertex = mf->v1;
+ else if (dist_v2 < dist_v3) index_nearest_vertex = mf->v2;
+ else index_nearest_vertex = mf->v3;
if (f_index == 3) {
dist_v4 = len_squared_v3v3(tmp_co, mv_src[mf->v4].co);
if (dist_v4 < dist_v1 && dist_v4 < dist_v2 && dist_v4 < dist_v3) {
More information about the Bf-blender-cvs
mailing list