From bba4a09b2f0b73f0a38e1eccc403a4cef536f703 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 6 Mar 2020 12:50:56 +1100 Subject: Cleanup: use 'BKE_' prefix for BKE_deform API calls - Use 'BKE_object_defgroup' prefix for object functions. - Rename 'defvert_verify_index' to 'defvert_ensure_index' since this adds the group if it isn't found. --- source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c | 10 ++++++---- source/blender/draw/intern/draw_cache_extract_mesh.c | 4 ++-- source/blender/draw/intern/draw_cache_impl_lattice.c | 2 +- 3 files changed, 9 insertions(+), 7 deletions(-) (limited to 'source/blender/draw') diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c index cfd99b0bdfc..51a63a00c24 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c +++ b/source/blender/draw/engines/gpencil/gpencil_draw_cache_impl.c @@ -772,8 +772,9 @@ void gpencil_get_edit_geom(struct GpencilBatchCacheElem *be, for (int i = 0; i < gps->totpoints; i++, pt++) { /* weight paint */ if (is_weight_paint) { - float weight = (dvert && dvert->dw && (vgindex > -1)) ? defvert_find_weight(dvert, vgindex) : - 0.0f; + float weight = (dvert && dvert->dw && (vgindex > -1)) ? + BKE_defvert_find_weight(dvert, vgindex) : + 0.0f; float hue = 2.0f * (1.0f - weight) / 3.0f; hsv_to_rgb(hue, 1.0f, 1.0f, &selectColor[0], &selectColor[1], &selectColor[2]); selectColor[3] = 1.0f; @@ -858,8 +859,9 @@ void gpencil_get_edlin_geom(struct GpencilBatchCacheElem *be, for (int i = 0; i < gps->totpoints; i++, pt++) { /* weight paint */ if (is_weight_paint) { - float weight = (dvert && dvert->dw && (vgindex > -1)) ? defvert_find_weight(dvert, vgindex) : - 0.0f; + float weight = (dvert && dvert->dw && (vgindex > -1)) ? + BKE_defvert_find_weight(dvert, vgindex) : + 0.0f; float hue = 2.0f * (1.0f - weight) / 3.0f; hsv_to_rgb(hue, 1.0f, 1.0f, &selectColor[0], &selectColor[1], &selectColor[2]); selectColor[3] = 1.0f; diff --git a/source/blender/draw/intern/draw_cache_extract_mesh.c b/source/blender/draw/intern/draw_cache_extract_mesh.c index 4045995e1e6..b385facd9aa 100644 --- a/source/blender/draw/intern/draw_cache_extract_mesh.c +++ b/source/blender/draw/intern/draw_cache_extract_mesh.c @@ -2420,7 +2420,7 @@ static float evaluate_vertex_weight(const MDeformVert *dvert, const DRW_MeshWeig } else { /* default, non tricky behavior */ - input = defvert_find_weight(dvert, wstate->defgroup_active); + input = BKE_defvert_find_weight(dvert, wstate->defgroup_active); if (input == 0.0f) { switch (wstate->alert_mode) { @@ -2428,7 +2428,7 @@ static float evaluate_vertex_weight(const MDeformVert *dvert, const DRW_MeshWeig return -1.0f; break; case OB_DRAW_GROUPUSER_ALL: - if (defvert_is_weight_zero(dvert, wstate->defgroup_len)) { + if (BKE_defvert_is_weight_zero(dvert, wstate->defgroup_len)) { return -1.0f; } break; diff --git a/source/blender/draw/intern/draw_cache_impl_lattice.c b/source/blender/draw/intern/draw_cache_impl_lattice.c index 8e5e22a4bcd..144bfac0b21 100644 --- a/source/blender/draw/intern/draw_cache_impl_lattice.c +++ b/source/blender/draw/intern/draw_cache_impl_lattice.c @@ -366,7 +366,7 @@ static GPUVertBuf *lattice_batch_cache_get_pos(LatticeRenderData *rdata, if (use_weight) { const float no_active_weight = 666.0f; - float weight = (actdef > -1) ? defvert_find_weight(rdata->dvert + i, actdef) : + float weight = (actdef > -1) ? BKE_defvert_find_weight(rdata->dvert + i, actdef) : no_active_weight; GPU_vertbuf_attr_set(cache->pos, attr_id.col, i, &weight); } -- cgit v1.2.3