From 41cbc47fbe1598fc7f41f977d8c64a826c86be9d Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 30 Dec 2011 11:37:54 +0000 Subject: fix [#29686] Weight paint paints when it shouldn't disallow painting when active group is locked --- source/blender/editors/sculpt_paint/paint_vertex.c | 24 +++++++++------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'source/blender/editors') diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index 2232f3ae9ad..76185d7c5cf 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -1880,12 +1880,13 @@ static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *UNUSED Object *ob= CTX_data_active_object(C); struct WPaintData *wpd; Mesh *me; - -// bDeformGroup *dg; + bDeformGroup *dg; float mat[4][4], imat[4][4]; - if(scene->obedit) return OPERATOR_CANCELLED; + if(scene->obedit) { + return FALSE; + } me= get_mesh(ob); if(me==NULL || me->totface==0) return OPERATOR_PASS_THROUGH; @@ -1924,22 +1925,17 @@ static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *UNUSED /* ensure we dont try paint onto an invalid group */ if (ob->actdef <= 0) { - return OPERATOR_PASS_THROUGH; + BKE_report(op->reports, RPT_WARNING, "No active vertex group for painting, aborting"); + return FALSE; } -#if 0 /* check if we are attempting to paint onto a locked vertex group, * and other options disallow it from doing anything useful */ dg = BLI_findlink(&ob->defbase, (ob->actdef-1)); - if ( (dg->flag & DG_LOCK_WEIGHT) && - (ts->auto_normalize == FALSE) && - (ts->multipaint == FALSE) ) - { - BKE_report(op->reports, RPT_WARNING, "Active group is locked, multi-paint/normalize disabled, aborting"); - - return OPERATOR_CANCELLED; + if (dg->flag & DG_LOCK_WEIGHT) { + BKE_report(op->reports, RPT_WARNING, "Active group is locked, aborting"); + return FALSE; } -#endif /* ALLOCATIONS! no return after this line */ /* make mode data storage */ @@ -1973,7 +1969,7 @@ static int wpaint_stroke_test_start(bContext *C, wmOperator *op, wmEvent *UNUSED wpd->vgroup_mirror = wpaint_mirror_vgroup_ensure(ob, wpd->vgroup_active); } - return 1; + return TRUE; } static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, PointerRNA *itemptr) -- cgit v1.2.3