diff options
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_vertex.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_vertex.c | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c index e058f924a7b..d90f9a80b37 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.c +++ b/source/blender/editors/sculpt_paint/paint_vertex.c @@ -91,12 +91,12 @@ static bool vertex_paint_use_fast_update_check(Object *ob) } } - return FALSE; + return false; } /* if the polygons from the mesh and the 'derivedFinal' match * we can assume that no modifiers are applied and that its worth adding tessellated faces - * so 'vertex_paint_use_fast_update_check()' returns TRUE */ + * so 'vertex_paint_use_fast_update_check()' returns true */ static bool vertex_paint_use_tessface_check(Object *ob, Mesh *me) { DerivedMesh *dm = ob->derivedFinal; @@ -105,7 +105,7 @@ static bool vertex_paint_use_tessface_check(Object *ob, Mesh *me) return (me->mpoly == CustomData_get_layer(&dm->polyData, CD_MPOLY)); } - return FALSE; + return false; } static void update_tessface_data(Object *ob, Mesh *me) @@ -226,7 +226,7 @@ static void do_shared_vertex_tesscol(Mesh *me, bool *mfacetag) mface = me->mface; mcol = (char *)me->mcol; for (a = me->totface; a > 0; a--, mface++, mcol += 16) { - if ((use_face_sel == FALSE) || (mface->flag & ME_FACE_SEL)) { + if ((use_face_sel == false) || (mface->flag & ME_FACE_SEL)) { scol = scolmain + 4 * mface->v1; scol[0]++; scol[1] += mcol[1]; scol[2] += mcol[2]; scol[3] += mcol[3]; scol = scolmain + 4 * mface->v2; @@ -255,7 +255,7 @@ static void do_shared_vertex_tesscol(Mesh *me, bool *mfacetag) mcol = (char *)me->mcol; mftag = mfacetag; for (a = me->totface; a > 0; a--, mface++, mcol += 16, mftag += 4) { - if ((use_face_sel == FALSE) || (mface->flag & ME_FACE_SEL)) { + if ((use_face_sel == false) || (mface->flag & ME_FACE_SEL)) { if (mftag[0]) { scol = scolmain + 4 * mface->v1; mcol[1] = scol[1]; mcol[2] = scol[2]; mcol[3] = scol[3]; @@ -297,7 +297,7 @@ static void do_shared_vertexcol(Mesh *me, bool *mlooptag, bool *mfacetag, const scol = MEM_callocN(sizeof(int) * me->totvert * 5, "scol"); for (i = 0, mp = me->mpoly; i < me->totpoly; i++, mp++) { - if ((use_face_sel == FALSE) || (mp->flag & ME_FACE_SEL)) { + if ((use_face_sel == false) || (mp->flag & ME_FACE_SEL)) { MLoop *ml = me->mloop + mp->loopstart; MLoopCol *lcol = me->mloopcol + mp->loopstart; for (j = 0; j < mp->totloop; j++, ml++, lcol++) { @@ -320,7 +320,7 @@ static void do_shared_vertexcol(Mesh *me, bool *mlooptag, bool *mfacetag, const } for (i = 0, mp = me->mpoly; i < me->totpoly; i++, mp++) { - if ((use_face_sel == FALSE) || (mp->flag & ME_FACE_SEL)) { + if ((use_face_sel == false) || (mp->flag & ME_FACE_SEL)) { MLoop *ml = me->mloop + mp->loopstart; MLoopCol *lcol = me->mloopcol + mp->loopstart; for (j = 0; j < mp->totloop; j++, ml++, lcol++) { @@ -1055,13 +1055,13 @@ static float wpaint_blend(VPaint *wp, float weight, float weight_prev, weight = wpaint_blend_tool(tool, weight, paintval, alpha); /* delay clamping until the end so multi-paint can function when the active group is at the limits */ - if (do_multipaint_totsel == FALSE) { + if (do_multipaint_totsel == false) { CLAMP(weight, 0.0f, 1.0f); } /* if no spray, clip result with orig weight & orig alpha */ if ((wp->flag & VP_SPRAY) == 0) { - if (do_multipaint_totsel == FALSE) { + if (do_multipaint_totsel == false) { float testw = wpaint_blend_tool(tool, weight_prev, paintval, brush_alpha_value); CLAMP(testw, 0.0f, 1.0f); @@ -1102,7 +1102,7 @@ static int weight_sample_invoke(bContext *C, wmOperator *op, const wmEvent *even ED_view3d_init_mats_rv3d(vc.obact, vc.rv3d); if (use_vert_sel) { - if (ED_mesh_pick_vert(C, vc.obact, event->mval, &index, ED_MESH_PICK_DEFAULT_VERT_SIZE, TRUE)) { + if (ED_mesh_pick_vert(C, vc.obact, event->mval, &index, ED_MESH_PICK_DEFAULT_VERT_SIZE, true)) { v_idx_best = index; } } @@ -1153,16 +1153,16 @@ void PAINT_OT_weight_sample(wmOperatorType *ot) } /* samples cursor location, and gives menu with vertex groups to activate */ -static int weight_paint_sample_enum_itemf__helper(const MDeformVert *dvert, const int defbase_tot, int *groups) +static bool weight_paint_sample_enum_itemf__helper(const MDeformVert *dvert, const int defbase_tot, int *groups) { /* this func fills in used vgroup's */ - int found = FALSE; + bool found = false; int i = dvert->totweight; MDeformWeight *dw; for (dw = dvert->dw; i > 0; dw++, i--) { if (dw->def_nr < defbase_tot) { - groups[dw->def_nr] = TRUE; - found = TRUE; + groups[dw->def_nr] = true; + found = true; } } return found; @@ -1182,7 +1182,7 @@ static EnumPropertyItem *weight_paint_sample_enum_itemf(bContext *C, PointerRNA const int defbase_tot = BLI_countlist(&vc.obact->defbase); const int use_vert_sel = (me->editflag & ME_EDIT_PAINT_VERT_SEL) != 0; int *groups = MEM_callocN(defbase_tot * sizeof(int), "groups"); - int found = FALSE; + bool found = false; unsigned int index; int mval[2] = {win->eventstate->x - vc.ar->winrct.xmin, @@ -1192,7 +1192,7 @@ static EnumPropertyItem *weight_paint_sample_enum_itemf(bContext *C, PointerRNA ED_view3d_init_mats_rv3d(vc.obact, vc.rv3d); if (use_vert_sel) { - if (ED_mesh_pick_vert(C, vc.obact, mval, &index, ED_MESH_PICK_DEFAULT_VERT_SIZE, TRUE)) { + if (ED_mesh_pick_vert(C, vc.obact, mval, &index, ED_MESH_PICK_DEFAULT_VERT_SIZE, true)) { MDeformVert *dvert = &me->dvert[index]; found |= weight_paint_sample_enum_itemf__helper(dvert, defbase_tot, groups); } @@ -1209,7 +1209,7 @@ static EnumPropertyItem *weight_paint_sample_enum_itemf(bContext *C, PointerRNA } } - if (found == FALSE) { + if (found == false) { MEM_freeN(groups); } else { @@ -1387,11 +1387,11 @@ static bool has_locked_group(MDeformVert *dvert, const int defbase_tot, for (i = dvert->totweight, dw = dvert->dw; i != 0; i--, dw++) { if (dw->def_nr < defbase_tot) { if (bone_groups[dw->def_nr] && lock_flags[dw->def_nr] && dw->weight > 0.0f) { - return TRUE; + return true; } } } - return FALSE; + return false; } static bool has_locked_group_selected(int defbase_tot, const bool *defbase_sel, const bool *lock_flags) @@ -1412,14 +1412,14 @@ static bool has_unselected_unlocked_bone_group(int defbase_tot, bool *defbase_se { int i; if (defbase_tot == selected) { - return FALSE; + return false; } for (i = 0; i < defbase_tot; i++) { if (vgroup_validmap[i] && !defbase_sel[i] && !lock_flags[i]) { - return TRUE; + return true; } } - return FALSE; + return false; } #endif @@ -1488,7 +1488,7 @@ static float redistribute_change(MDeformVert *ndv, const int defbase_tot, if (change_status[ndw->def_nr] == change_me) { oldval = ndw->weight; /* if auto normalize is active, don't worry about upper bounds */ - if (do_auto_normalize == FALSE && ndw->weight + change > 1) { + if (do_auto_normalize == false && ndw->weight + change > 1) { totchange -= 1.0f - ndw->weight; ndw->weight = 1.0f; /* stop the changes to this group */ @@ -1707,7 +1707,7 @@ typedef struct WeightPaintInfo { } WeightPaintInfo; /* fresh start to make multi-paint and locking modular */ -/* returns TRUE if it thinks you need to reset the weights due to +/* returns true if it thinks you need to reset the weights due to * normalizing while multi-painting * * note: this assumes dw->def_nr range has been checked by the caller @@ -1753,19 +1753,19 @@ static int apply_mp_locks_normalize(Mesh *me, const WeightPaintInfo *wpi, if (neww > oldw) { if (tdw->weight <= oldw) { MEM_freeN(dv_test.dw); - return TRUE; + return true; } } else { if (tdw->weight >= oldw) { MEM_freeN(dv_test.dw); - return TRUE; + return true; } } } } MEM_freeN(dv_test.dw); - return FALSE; + return false; } /* within the current dvert index, get the dw that is selected and has a weight @@ -1875,11 +1875,11 @@ static void do_weight_paint_vertex( /* If there are no locks or multipaint, * then there is no need to run the more complicated checks */ - if ((do_multipaint_totsel == FALSE) && - (wpi->lock_flags == NULL || has_locked_group(dv, wpi->defbase_tot, wpi->vgroup_validmap, wpi->lock_flags) == FALSE)) + if ((do_multipaint_totsel == false) && + (wpi->lock_flags == NULL || has_locked_group(dv, wpi->defbase_tot, wpi->vgroup_validmap, wpi->lock_flags) == false)) { dw->weight = wpaint_blend(wp, dw->weight, dw_prev->weight, alpha, paintweight, - wpi->brush_alpha_value, wpi->do_flip, FALSE); + wpi->brush_alpha_value, wpi->do_flip, false); /* WATCH IT: take care of the ordering of applying mirror -> normalize, * can give wrong results [#26193], least confusing if normalize is done last */ @@ -2149,11 +2149,11 @@ static bool wpaint_ensure_data(bContext *C, wmOperator *op) Mesh *me = BKE_mesh_from_object(ob); if (scene->obedit) { - return FALSE; + return false; } if (me == NULL || me->totpoly == 0) { - return FALSE; + return false; } /* if nothing was added yet, we make dverts and a vertex deform group */ @@ -2191,10 +2191,10 @@ static bool wpaint_ensure_data(bContext *C, wmOperator *op) /* ensure we don't try paint onto an invalid group */ if (ob->actdef <= 0) { BKE_report(op->reports, RPT_WARNING, "No active vertex group for painting, aborting"); - return FALSE; + return false; } - return TRUE; + return true; } static bool wpaint_stroke_test_start(bContext *C, wmOperator *op, const float UNUSED(mouse[2])) @@ -2209,8 +2209,8 @@ static bool wpaint_stroke_test_start(bContext *C, wmOperator *op, const float UN float mat[4][4], imat[4][4]; - if (wpaint_ensure_data(C, op) == FALSE) { - return FALSE; + if (wpaint_ensure_data(C, op) == false) { + return false; } { @@ -2219,7 +2219,7 @@ static bool wpaint_stroke_test_start(bContext *C, wmOperator *op, const float UN bDeformGroup *dg = BLI_findlink(&ob->defbase, (ob->actdef - 1)); if (dg->flag & DG_LOCK_WEIGHT) { BKE_report(op->reports, RPT_WARNING, "Active group is locked, aborting"); - return FALSE; + return false; } } @@ -2256,7 +2256,7 @@ static bool wpaint_stroke_test_start(bContext *C, wmOperator *op, const float UN wpd->vgroup_mirror = wpaint_mirror_vgroup_ensure(ob, wpd->vgroup_active); } - return TRUE; + return true; } static void wpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, PointerRNA *itemptr) @@ -2611,7 +2611,7 @@ static int weight_paint_set_exec(bContext *C, wmOperator *op) Brush *brush = BKE_paint_brush(&ts->wpaint->paint); float vgroup_weight = BKE_brush_weight_get(scene, brush); - if (wpaint_ensure_data(C, op) == FALSE) { + if (wpaint_ensure_data(C, op) == false) { return OPERATOR_CANCELLED; } @@ -2823,11 +2823,11 @@ static bool vpaint_stroke_test_start(bContext *C, struct wmOperator *op, const f * if not we can skip face map trickyness */ if (vertex_paint_use_fast_update_check(ob)) { vpaint_build_poly_facemap(vpd, me); - vpd->use_fast_update = TRUE; + vpd->use_fast_update = true; /* printf("Fast update!\n");*/ } else { - vpd->use_fast_update = FALSE; + vpd->use_fast_update = false; /* printf("No fast update!\n");*/ } @@ -3024,7 +3024,7 @@ static void vpaint_stroke_update_step(bContext *C, struct PaintStroke *stroke, P ED_region_tag_redraw(vc->ar); - if (vpd->use_fast_update == FALSE) { + if (vpd->use_fast_update == false) { /* recalculate modifier stack to get new colors, slow, * avoid this if we can! */ DAG_id_tag_update(ob->data, 0); @@ -3206,7 +3206,7 @@ static void gradientVert__mapFunc(void *userData, int index, const float co[3], DMGradient_userData *grad_data = userData; Mesh *me = grad_data->me; - if (grad_data->use_select == FALSE || (me->mvert[index].flag & SELECT)) { + if (grad_data->use_select == false || (me->mvert[index].flag & SELECT)) { DMGradient_vertStore *vs = &grad_data->vert_cache[index]; /* run first pass only, could be split into its own mapFunc @@ -3356,7 +3356,7 @@ static int paint_weight_gradient_exec(bContext *C, wmOperator *op) vert_cache = gesture->userdata; } else { - if (wpaint_ensure_data(C, op) == FALSE) { + if (wpaint_ensure_data(C, op) == false) { return OPERATOR_CANCELLED; } @@ -3404,7 +3404,7 @@ static int paint_weight_gradient_invoke(bContext *C, wmOperator *op, const wmEve { int ret; - if (wpaint_ensure_data(C, op) == FALSE) { + if (wpaint_ensure_data(C, op) == false) { return OPERATOR_CANCELLED; } |