Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(432)

Issue 6301097: Weight paint transfer

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 11 months ago by Cyborgmuppet
Modified:
11 years, 11 months ago
Reviewers:
ideasman42, bf-codereview
Base URL:
https://svn.blender.org/svnroot/bf-blender/trunk/blender/
Visibility:
Public.

Description

Weight paint transfer

Patch Set 1 #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+369 lines, -3 lines) Patch
M release/scripts/startup/bl_ui/space_view3d_toolbar.py View 1 chunk +1 line, -0 lines 0 comments Download
M source/blender/editors/object/object_intern.h View 1 chunk +1 line, -0 lines 0 comments Download
M source/blender/editors/object/object_ops.c View 1 chunk +1 line, -0 lines 0 comments Download
M source/blender/editors/object/object_vgroup.c View 5 chunks +366 lines, -3 lines 8 comments Download

Messages

Total messages: 2
Cyborgmuppet
11 years, 11 months ago (2012-06-19 02:28:17 UTC) #1
ideasman42
11 years, 11 months ago (2012-06-19 07:27:34 UTC) #2
There are some logical errors with copying still that need resolving.

http://codereview.appspot.com/6301097/diff/1/source/blender/editors/object/ob...
File source/blender/editors/object/object_vgroup.c (right):

http://codereview.appspot.com/6301097/diff/1/source/blender/editors/object/ob...
source/blender/editors/object/object_vgroup.c:469: BKE_reportf(op->reports,
RPT_ERROR, "Transfer failed. Source mesh does not have vertices");
should be 'Source mesh does not have any vertex groups'

http://codereview.appspot.com/6301097/diff/1/source/blender/editors/object/ob...
source/blender/editors/object/object_vgroup.c:515: }
there should be an 'else {' ... here, which checks if 'dv_dst' has any weights
and clears them (at least when overwrite is enabled).

This will depend on the options selected, but you see the issue I hope.

http://codereview.appspot.com/6301097/diff/1/source/blender/editors/object/ob...
source/blender/editors/object/object_vgroup.c:543: }
there should be an 'else {' ... here, which checks if 'dv_dst' has any weights
and clears them (at least when overwrite is enabled). This will depend on the
options selected, but you see the issue I hope.

http://codereview.appspot.com/6301097/diff/1/source/blender/editors/object/ob...
source/blender/editors/object/object_vgroup.c:599: if
(&mface_src[index_nearest].v4 != NULL) v = 4;
comparing v4 with NULL is misleading, since its not a pointer.
suggest to use this:

mf = &mface_src[index_nearest];
fidx = mf->v4 ? 3 : 2;
do {
    unsigned int vidx = (&mf->v1)[fidx];
    ... operate on vidx ...
} while (fidx--);

http://codereview.appspot.com/6301097/diff/1/source/blender/editors/object/ob...
source/blender/editors/object/object_vgroup.c:602: weight += tmp_weight[j] *
defvert_find_index(dv_array_src[(&mface_src[index_nearest].v1)[j]],
index_src)->weight;
defvert_find_index may be a NULL pointer, so getting ->weight from it may crash.

better use defvert_find_weight() here which falls back to 0.0 when not found.

http://codereview.appspot.com/6301097/diff/1/source/blender/editors/object/ob...
source/blender/editors/object/object_vgroup.c:649: if
(&mface_src[index_nearest].v4 != NULL) {
comparing v4 with NULL is misleading... see above.

http://codereview.appspot.com/6301097/diff/1/source/blender/editors/object/ob...
source/blender/editors/object/object_vgroup.c:661: }
there should be an 'else {' ... here, which checks if 'dv_dst' has any weights
and clears them (at least when overwrite is enabled). This will depend on the
options selected, but you see the issue I hope.

http://codereview.appspot.com/6301097/diff/1/source/blender/editors/object/ob...
source/blender/editors/object/object_vgroup.c:3121: ot->prop =
RNA_def_enum(ot->srna, "method_mode", method_mode_item, 3, "Method", "");
just 'method' would be better.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b