diff options
author | Ove Murberg Henriksen <sorayasilvermoon@hotmail.com> | 2012-10-10 12:29:13 +0400 |
---|---|---|
committer | Ove Murberg Henriksen <sorayasilvermoon@hotmail.com> | 2012-10-10 12:29:13 +0400 |
commit | 89969a07f0f665f83ef0cea6e2302f2237407196 (patch) | |
tree | 03d45eb507965225c8ae03bb2fe2e2875c6aa5a9 /source/blender/editors/object/object_vgroup.c | |
parent | cf3a5d94f0d4b8cd67fd7600e6c22972e173cc60 (diff) |
Changing clear weight code from "assigning 0" to "removing".
Its less efficient but better practice.
+ Some style clean.
Diffstat (limited to 'source/blender/editors/object/object_vgroup.c')
-rw-r--r-- | source/blender/editors/object/object_vgroup.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index ab9a4cb07ec..f1a31f8bfaa 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -507,14 +507,13 @@ static int ed_vgroup_transfer_weight(Object *ob_dst, Object *ob_src, bDeformGrou /* clear weights */ if (replace_mode == WT_REPLACE_ALL_WEIGHTS) { - for(i = 0, dv_dst = dv_array_dst; i < me_dst->totvert; i++, dv_dst++) { + for (i = 0, dv_dst = dv_array_dst; i < me_dst->totvert; i++, dv_dst++) { - if (*dv_dst == NULL) { - continue; - } + if (*dv_dst == NULL) continue; dw_dst = defvert_verify_index(*dv_dst, index_dst); - if (dw_dst) (*dw_dst).weight = 0; + /* remove vertex from group */ + if (dw_dst) defvert_remove_group(*dv_dst, dw_dst); } } @@ -562,7 +561,7 @@ static int ed_vgroup_transfer_weight(Object *ob_dst, Object *ob_src, bDeformGrou /* reset nearest */ nearest.dist = FLT_MAX; - /* With current binary tree its marginally faster to start searching at the top, as opposed to previous search. */ + /* with current binary tree its marginally faster to start searching at the top, as opposed to previous search. */ nearest.index = -1; /* transform into target space */ @@ -601,7 +600,7 @@ static int ed_vgroup_transfer_weight(Object *ob_dst, Object *ob_src, bDeformGrou /* reset nearest */ nearest.dist = FLT_MAX; - /* With current binary tree its marginally faster to start searching at the top, as opposed to previous search. */ + /* with current binary tree its marginally faster to start searching at the top, as opposed to previous search. */ nearest.index = -1; /* transform into target space */ |