[Bf-codereview] Weight paint transfer (issue 6305103)
ideasman42 at gmail.com
ideasman42 at gmail.com
Sun Jun 17 23:32:15 CEST 2012
http://codereview.appspot.com/6305103/diff/1/source/blender/editors/object/object_vgroup.c
File source/blender/editors/object/object_vgroup.c (right):
http://codereview.appspot.com/6305103/diff/1/source/blender/editors/object/object_vgroup.c#newcode467
source/blender/editors/object/object_vgroup.c:467: if (!me_src->dvert)
return 0;
this should give some report/warning I think, not fail silently.
http://codereview.appspot.com/6305103/diff/1/source/blender/editors/object/object_vgroup.c#newcode532
source/blender/editors/object/object_vgroup.c:532: dw_src =
defvert_verify_index(dv_array_src[nearest.index], index_src);
this is very bad - this function will add a vertex weight if not found,
thereby modifying the source which should never happen. use
defvert_find_index() instead.
You will need to do something sane when the vgroup is not found - it
should not add any vgroups or act as if all vgroups are 0 weight.
http://codereview.appspot.com/6305103/diff/1/source/blender/editors/object/object_vgroup.c#newcode572
source/blender/editors/object/object_vgroup.c:572: /* interpolate
weights */
this is wrong, it assumes a quad, which isnt always the case.
http://codereview.appspot.com/6305103/diff/1/source/blender/editors/object/object_vgroup.c#newcode578
source/blender/editors/object/object_vgroup.c:578: /* get weights */
you can loop over 3-4 items here, ratrher then inline all 4 calls.
paint_vertex.c has examples of this.
http://codereview.appspot.com/6305103/diff/1/source/blender/editors/object/object_vgroup.c#newcode579
source/blender/editors/object/object_vgroup.c:579: weight =
tmp_weight[0] *
defvert_verify_index(dv_array_src[mface_src[index_nearest].v1],
index_src)->weight;
use defvert_find_index()
http://codereview.appspot.com/6305103/diff/1/source/blender/editors/object/object_vgroup.c#newcode636
source/blender/editors/object/object_vgroup.c:636: dw_src =
defvert_verify_index(dv_array_src[index_nearest_vertex], index_src);
use defvert_find_index()
http://codereview.appspot.com/6305103/diff/1/source/blender/editors/object/object_vgroup.c#newcode3093
source/blender/editors/object/object_vgroup.c:3093: ot->prop =
RNA_def_enum(ot->srna, "vertex_group_option", vertex_group_option_item,
1, "Group", "");
adding _option" to the end of all options is a bit strange - perhaps
_method or _mode is better?
http://codereview.appspot.com/6305103/
More information about the Bf-codereview
mailing list