From 7a633d7c4f9fdc271bae7b7c83116c5ce61f4b1a Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Wed, 13 Jul 2016 13:57:46 +1000 Subject: Vertex/Weight Paint: Support view-selected on last-stroke D1875 by @lichtwerk --- source/blender/editors/sculpt_paint/paint_vertex.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'source/blender/editors/sculpt_paint/paint_vertex.c') diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 3bcd610150c..7b296473f31 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -2380,9 +2380,8 @@ static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P swap_m4m4(vc->rv3d->persmat, mat); /* calculate pivot for rotation around seletion if needed */ - if (U.uiflag & USER_ORBIT_SELECTION) { - paint_last_stroke_update(scene, vc->ar, mval); - } + /* also needed for "View Selected" on last stroke */ + paint_last_stroke_update(scene, vc->ar, mval); DAG_id_tag_update(ob->data, 0); ED_region_tag_redraw(vc->ar); @@ -2858,9 +2857,8 @@ static void vpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P } /* calculate pivot for rotation around seletion if needed */ - if (U.uiflag & USER_ORBIT_SELECTION) { - paint_last_stroke_update(scene, vc->ar, mval); - } + /* also needed for "View Selected" on last stroke */ + paint_last_stroke_update(scene, vc->ar, mval); ED_region_tag_redraw(vc->ar); -- cgit v1.2.3 From 2b77b1ce465ab09052567a58d1b9f6a014a563cd Mon Sep 17 00:00:00 2001 From: Mike Erwin Date: Thu, 21 Jul 2016 21:31:37 -0400 Subject: remove double-checked conditions MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Checking a condition right after we’ve checked it (and it hasn’t changed). Most of these are trivial to understand. split_quads in convertblender.c: It seems quads should be processed and triangles should be marked as not needing split. So I removed the outer vlr->v4 check. Found with PVS-Studio T48917 --- source/blender/editors/sculpt_paint/paint_vertex.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'source/blender/editors/sculpt_paint/paint_vertex.c') diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 7b296473f31..991025a4d5d 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -257,9 +257,7 @@ static bool make_vertexcol(Object *ob) /* single ob */ /* copies from shadedisplist to mcol */ if (!me->mloopcol && me->totloop) { - if (!me->mloopcol) { - CustomData_add_layer(&me->ldata, CD_MLOOPCOL, CD_DEFAULT, NULL, me->totloop); - } + CustomData_add_layer(&me->ldata, CD_MLOOPCOL, CD_DEFAULT, NULL, me->totloop); BKE_mesh_update_customdata_pointers(me, true); } -- cgit v1.2.3