diff options
Diffstat (limited to 'source/blender/modifiers/intern')
27 files changed, 81 insertions, 77 deletions
diff --git a/source/blender/modifiers/intern/MOD_bevel.c b/source/blender/modifiers/intern/MOD_bevel.c index 14f1650d690..9ec4d58eb61 100644 --- a/source/blender/modifiers/intern/MOD_bevel.c +++ b/source/blender/modifiers/intern/MOD_bevel.c @@ -148,8 +148,9 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes } else if (vgroup != -1) { weight = invert_vgroup ? - 1.0f - defvert_array_find_weight_safe(dvert, BM_elem_index_get(v), vgroup) : - defvert_array_find_weight_safe(dvert, BM_elem_index_get(v), vgroup); + 1.0f - + BKE_defvert_array_find_weight_safe(dvert, BM_elem_index_get(v), vgroup) : + BKE_defvert_array_find_weight_safe(dvert, BM_elem_index_get(v), vgroup); /* Check is against 0.5 rather than != 0.0 because cascaded bevel modifiers will * interpolate weights for newly created vertices, and may cause unexpected "selection" */ if (weight < 0.5f) { @@ -184,13 +185,13 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes } else if (vgroup != -1) { weight = invert_vgroup ? - 1.0f - defvert_array_find_weight_safe( + 1.0f - BKE_defvert_array_find_weight_safe( dvert, BM_elem_index_get(e->v1), vgroup) : - defvert_array_find_weight_safe(dvert, BM_elem_index_get(e->v1), vgroup); - weight2 = invert_vgroup ? - 1.0f - defvert_array_find_weight_safe( - dvert, BM_elem_index_get(e->v2), vgroup) : - defvert_array_find_weight_safe(dvert, BM_elem_index_get(e->v2), vgroup); + BKE_defvert_array_find_weight_safe(dvert, BM_elem_index_get(e->v1), vgroup); + weight2 = invert_vgroup ? 1.0f - BKE_defvert_array_find_weight_safe( + dvert, BM_elem_index_get(e->v2), vgroup) : + BKE_defvert_array_find_weight_safe( + dvert, BM_elem_index_get(e->v2), vgroup); if (weight < 0.5f || weight2 < 0.5f) { continue; } diff --git a/source/blender/modifiers/intern/MOD_cast.c b/source/blender/modifiers/intern/MOD_cast.c index 4cb73289636..b562152d906 100644 --- a/source/blender/modifiers/intern/MOD_cast.c +++ b/source/blender/modifiers/intern/MOD_cast.c @@ -199,8 +199,9 @@ static void sphere_do(CastModifierData *cmd, } if (dvert) { - const float weight = invert_vgroup ? 1.0f - defvert_find_weight(&dvert[i], defgrp_index) : - defvert_find_weight(&dvert[i], defgrp_index); + const float weight = invert_vgroup ? + 1.0f - BKE_defvert_find_weight(&dvert[i], defgrp_index) : + BKE_defvert_find_weight(&dvert[i], defgrp_index); if (weight == 0.0f) { continue; @@ -370,8 +371,9 @@ static void cuboid_do(CastModifierData *cmd, } if (dvert) { - const float weight = invert_vgroup ? 1.0f - defvert_find_weight(&dvert[i], defgrp_index) : - defvert_find_weight(&dvert[i], defgrp_index); + const float weight = invert_vgroup ? + 1.0f - BKE_defvert_find_weight(&dvert[i], defgrp_index) : + BKE_defvert_find_weight(&dvert[i], defgrp_index); if (weight == 0.0f) { continue; diff --git a/source/blender/modifiers/intern/MOD_correctivesmooth.c b/source/blender/modifiers/intern/MOD_correctivesmooth.c index a746e265e39..0afe95a3ca3 100644 --- a/source/blender/modifiers/intern/MOD_correctivesmooth.c +++ b/source/blender/modifiers/intern/MOD_correctivesmooth.c @@ -124,7 +124,7 @@ static void mesh_get_weights(MDeformVert *dvert, uint i; for (i = 0; i < numVerts; i++, dvert++) { - const float w = defvert_find_weight(dvert, defgrp_index); + const float w = BKE_defvert_find_weight(dvert, defgrp_index); if (use_invert_vgroup == false) { smooth_weights[i] = w; diff --git a/source/blender/modifiers/intern/MOD_decimate.c b/source/blender/modifiers/intern/MOD_decimate.c index c113a2767a0..8680b514fdc 100644 --- a/source/blender/modifiers/intern/MOD_decimate.c +++ b/source/blender/modifiers/intern/MOD_decimate.c @@ -147,12 +147,12 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes if (dmd->flag & MOD_DECIM_FLAG_INVERT_VGROUP) { for (i = 0; i < vert_tot; i++) { - vweights[i] = 1.0f - defvert_find_weight(&dvert[i], defgrp_index); + vweights[i] = 1.0f - BKE_defvert_find_weight(&dvert[i], defgrp_index); } } else { for (i = 0; i < vert_tot; i++) { - vweights[i] = defvert_find_weight(&dvert[i], defgrp_index); + vweights[i] = BKE_defvert_find_weight(&dvert[i], defgrp_index); } } } diff --git a/source/blender/modifiers/intern/MOD_displace.c b/source/blender/modifiers/intern/MOD_displace.c index 196b0f5e126..46a9d4e676f 100644 --- a/source/blender/modifiers/intern/MOD_displace.c +++ b/source/blender/modifiers/intern/MOD_displace.c @@ -193,8 +193,8 @@ static void displaceModifier_do_task(void *__restrict userdata, float local_vec[3]; if (dvert) { - weight = invert_vgroup ? 1.0f - defvert_find_weight(dvert + iter, defgrp_index) : - defvert_find_weight(dvert + iter, defgrp_index); + weight = invert_vgroup ? 1.0f - BKE_defvert_find_weight(dvert + iter, defgrp_index) : + BKE_defvert_find_weight(dvert + iter, defgrp_index); if (weight == 0.0f) { return; } diff --git a/source/blender/modifiers/intern/MOD_explode.c b/source/blender/modifiers/intern/MOD_explode.c index 7dfa16ae909..e900b304c6f 100644 --- a/source/blender/modifiers/intern/MOD_explode.c +++ b/source/blender/modifiers/intern/MOD_explode.c @@ -130,8 +130,8 @@ static void createFacepa(ExplodeModifierData *emd, ParticleSystemModifierData *p for (i = 0; i < totvert; i++, dvert++) { float val = BLI_rng_get_float(rng); val = (1.0f - emd->protect) * val + emd->protect * 0.5f; - const float weight = invert_vgroup ? 1.0f - defvert_find_weight(dvert, defgrp_index) : - defvert_find_weight(dvert, defgrp_index); + const float weight = invert_vgroup ? 1.0f - BKE_defvert_find_weight(dvert, defgrp_index) : + BKE_defvert_find_weight(dvert, defgrp_index); if (val < weight) { vertpa[i] = -1; } diff --git a/source/blender/modifiers/intern/MOD_hook.c b/source/blender/modifiers/intern/MOD_hook.c index 6b5d7233b60..f09ec570202 100644 --- a/source/blender/modifiers/intern/MOD_hook.c +++ b/source/blender/modifiers/intern/MOD_hook.c @@ -238,8 +238,8 @@ static void hook_co_apply(struct HookData_cb *hd, const int j) if (fac) { if (hd->dvert) { - fac *= hd->invert_vgroup ? 1.0f - defvert_find_weight(&hd->dvert[j], hd->defgrp_index) : - defvert_find_weight(&hd->dvert[j], hd->defgrp_index); + fac *= hd->invert_vgroup ? 1.0f - BKE_defvert_find_weight(&hd->dvert[j], hd->defgrp_index) : + BKE_defvert_find_weight(&hd->dvert[j], hd->defgrp_index); } if (fac) { diff --git a/source/blender/modifiers/intern/MOD_laplaciandeform.c b/source/blender/modifiers/intern/MOD_laplaciandeform.c index f2f99b7ddfa..683696b0725 100644 --- a/source/blender/modifiers/intern/MOD_laplaciandeform.c +++ b/source/blender/modifiers/intern/MOD_laplaciandeform.c @@ -543,8 +543,8 @@ static void initSystem( BLI_assert(dvert != NULL); dv = dvert; for (i = 0; i < numVerts; i++) { - wpaint = invert_vgroup ? 1.0f - defvert_find_weight(dv, defgrp_index) : - defvert_find_weight(dv, defgrp_index); + wpaint = invert_vgroup ? 1.0f - BKE_defvert_find_weight(dv, defgrp_index) : + BKE_defvert_find_weight(dv, defgrp_index); dv++; if (wpaint > 0.0f) { STACK_PUSH(index_anchors, i); @@ -615,8 +615,8 @@ static int isSystemDifferent(LaplacianDeformModifierData *lmd, } dv = dvert; for (i = 0; i < numVerts; i++) { - wpaint = invert_vgroup ? 1.0f - defvert_find_weight(dv, defgrp_index) : - defvert_find_weight(dv, defgrp_index); + wpaint = invert_vgroup ? 1.0f - BKE_defvert_find_weight(dv, defgrp_index) : + BKE_defvert_find_weight(dv, defgrp_index); dv++; if (wpaint > 0.0f) { total_anchors++; diff --git a/source/blender/modifiers/intern/MOD_laplaciansmooth.c b/source/blender/modifiers/intern/MOD_laplaciansmooth.c index ea788d3f72b..97e94c46340 100644 --- a/source/blender/modifiers/intern/MOD_laplaciansmooth.c +++ b/source/blender/modifiers/intern/MOD_laplaciansmooth.c @@ -421,8 +421,8 @@ static void laplaciansmoothModifier_do( EIG_linear_solver_right_hand_side_add(sys->context, 2, i, vertexCos[i][2]); if (iter == 0) { if (dv) { - wpaint = invert_vgroup ? 1.0f - defvert_find_weight(dv, defgrp_index) : - defvert_find_weight(dv, defgrp_index); + wpaint = invert_vgroup ? 1.0f - BKE_defvert_find_weight(dv, defgrp_index) : + BKE_defvert_find_weight(dv, defgrp_index); dv++; } else { diff --git a/source/blender/modifiers/intern/MOD_mask.cc b/source/blender/modifiers/intern/MOD_mask.cc index fb179d2e485..0b2981fca36 100644 --- a/source/blender/modifiers/intern/MOD_mask.cc +++ b/source/blender/modifiers/intern/MOD_mask.cc @@ -124,7 +124,7 @@ static void compute_vertex_mask__vertex_group_mode(MDeformVert *dvert, MutableArrayRef<bool> r_vertex_mask) { for (int i : r_vertex_mask.index_range()) { - const bool found = defvert_find_weight(&dvert[i], defgrp_index) > threshold; + const bool found = BKE_defvert_find_weight(&dvert[i], defgrp_index) > threshold; r_vertex_mask[i] = found; } } @@ -324,7 +324,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes compute_vertex_mask__armature_mode(dvert, ob, armature_ob, mmd->threshold, vertex_mask); } else { - int defgrp_index = defgroup_name_index(ob, mmd->vgroup); + int defgrp_index = BKE_object_defgroup_name_index(ob, mmd->vgroup); /* Return input mesh if the vertex group does not exist. */ if (defgrp_index == -1) { diff --git a/source/blender/modifiers/intern/MOD_meshdeform.c b/source/blender/modifiers/intern/MOD_meshdeform.c index 5be26e2a2dd..28299d78371 100644 --- a/source/blender/modifiers/intern/MOD_meshdeform.c +++ b/source/blender/modifiers/intern/MOD_meshdeform.c @@ -284,7 +284,7 @@ static void meshdeform_vert_task(void *__restrict userdata, } if (dvert) { - fac = defvert_find_weight(&dvert[iter], defgrp_index); + fac = BKE_defvert_find_weight(&dvert[iter], defgrp_index); if (mmd->flag & MOD_MDEF_INVERT_VGROUP) { fac = 1.0f - fac; diff --git a/source/blender/modifiers/intern/MOD_simpledeform.c b/source/blender/modifiers/intern/MOD_simpledeform.c index 18236973ea2..f38a50bd672 100644 --- a/source/blender/modifiers/intern/MOD_simpledeform.c +++ b/source/blender/modifiers/intern/MOD_simpledeform.c @@ -316,7 +316,7 @@ static void SimpleDeformModifier_do(SimpleDeformModifierData *smd, axis_map_table[(smd->mode != MOD_SIMPLEDEFORM_MODE_BEND) ? deform_axis : 2]; for (i = 0; i < numVerts; i++) { - float weight = defvert_array_find_weight_safe(dvert, i, vgroup); + float weight = BKE_defvert_array_find_weight_safe(dvert, i, vgroup); if (invert_vgroup) { weight = 1.0f - weight; diff --git a/source/blender/modifiers/intern/MOD_skin.c b/source/blender/modifiers/intern/MOD_skin.c index 4371de62fca..b22874eb0bc 100644 --- a/source/blender/modifiers/intern/MOD_skin.c +++ b/source/blender/modifiers/intern/MOD_skin.c @@ -943,7 +943,7 @@ static Mesh *subdivide_base(Mesh *orig) weight = interpf(vg->w2, vg->w1, t); if (weight > 0) { - defvert_add_index_notest(&outdvert[v], vg->def_nr, weight); + BKE_defvert_add_index_notest(&outdvert[v], vg->def_nr, weight); } } @@ -1058,7 +1058,7 @@ static void output_frames(BMesh *bm, SkinNode *sn, const MDeformVert *input_dver dv = CustomData_bmesh_get(&bm->vdata, v->head.data, CD_MDEFORMVERT); BLI_assert(dv->totweight == 0); - defvert_copy(dv, input_dvert); + BKE_defvert_copy(dv, input_dvert); } } } diff --git a/source/blender/modifiers/intern/MOD_smooth.c b/source/blender/modifiers/intern/MOD_smooth.c index 4dcd89c9709..1a08083aa2f 100644 --- a/source/blender/modifiers/intern/MOD_smooth.c +++ b/source/blender/modifiers/intern/MOD_smooth.c @@ -141,8 +141,8 @@ static void smoothModifier_do( float *vco_new = accumulated_vecs[i]; const float f_new = invert_vgroup ? - (1.0f - defvert_find_weight(dv, defgrp_index)) * fac_new : - defvert_find_weight(dv, defgrp_index) * fac_new; + (1.0f - BKE_defvert_find_weight(dv, defgrp_index)) * fac_new : + BKE_defvert_find_weight(dv, defgrp_index) * fac_new; if (f_new <= 0.0f) { continue; } diff --git a/source/blender/modifiers/intern/MOD_solidify_extrude.c b/source/blender/modifiers/intern/MOD_solidify_extrude.c index 8c5a2551c0b..0be674ea2e8 100644 --- a/source/blender/modifiers/intern/MOD_solidify_extrude.c +++ b/source/blender/modifiers/intern/MOD_solidify_extrude.c @@ -578,10 +578,10 @@ Mesh *MOD_solidify_extrude_applyModifier(ModifierData *md, if (dvert) { MDeformVert *dv = &dvert[i]; if (defgrp_invert) { - scalar_short_vgroup = 1.0f - defvert_find_weight(dv, defgrp_index); + scalar_short_vgroup = 1.0f - BKE_defvert_find_weight(dv, defgrp_index); } else { - scalar_short_vgroup = defvert_find_weight(dv, defgrp_index); + scalar_short_vgroup = BKE_defvert_find_weight(dv, defgrp_index); } scalar_short_vgroup = (offset_fac_vg + (scalar_short_vgroup * offset_fac_vg_inv)) * scalar_short; @@ -625,10 +625,10 @@ Mesh *MOD_solidify_extrude_applyModifier(ModifierData *md, if (dvert) { MDeformVert *dv = &dvert[i]; if (defgrp_invert) { - scalar_short_vgroup = 1.0f - defvert_find_weight(dv, defgrp_index); + scalar_short_vgroup = 1.0f - BKE_defvert_find_weight(dv, defgrp_index); } else { - scalar_short_vgroup = defvert_find_weight(dv, defgrp_index); + scalar_short_vgroup = BKE_defvert_find_weight(dv, defgrp_index); } scalar_short_vgroup = (offset_fac_vg + (scalar_short_vgroup * offset_fac_vg_inv)) * scalar_short; @@ -740,14 +740,14 @@ Mesh *MOD_solidify_extrude_applyModifier(ModifierData *md, if (defgrp_invert) { for (i = 0; i < numVerts; i++, dv++) { - scalar = 1.0f - defvert_find_weight(dv, defgrp_index); + scalar = 1.0f - BKE_defvert_find_weight(dv, defgrp_index); scalar = offset_fac_vg + (scalar * offset_fac_vg_inv); vert_angles[i] *= scalar; } } else { for (i = 0; i < numVerts; i++, dv++) { - scalar = defvert_find_weight(dv, defgrp_index); + scalar = BKE_defvert_find_weight(dv, defgrp_index); scalar = offset_fac_vg + (scalar * offset_fac_vg_inv); vert_angles[i] *= scalar; } diff --git a/source/blender/modifiers/intern/MOD_solidify_nonmanifold.c b/source/blender/modifiers/intern/MOD_solidify_nonmanifold.c index 799c1c966a3..7dea4d2ccd7 100644 --- a/source/blender/modifiers/intern/MOD_solidify_nonmanifold.c +++ b/source/blender/modifiers/intern/MOD_solidify_nonmanifold.c @@ -1595,10 +1595,10 @@ Mesh *MOD_solidify_nonmanifold_applyModifier(ModifierData *md, if (dvert) { MDeformVert *dv = &dvert[i]; if (defgrp_invert) { - scalar_vgroup = 1.0f - defvert_find_weight(dv, defgrp_index); + scalar_vgroup = 1.0f - BKE_defvert_find_weight(dv, defgrp_index); } else { - scalar_vgroup = defvert_find_weight(dv, defgrp_index); + scalar_vgroup = BKE_defvert_find_weight(dv, defgrp_index); } scalar_vgroup = offset_fac_vg + (scalar_vgroup * offset_fac_vg_inv); } diff --git a/source/blender/modifiers/intern/MOD_util.c b/source/blender/modifiers/intern/MOD_util.c index 0fd4e6f9f72..d234570a974 100644 --- a/source/blender/modifiers/intern/MOD_util.c +++ b/source/blender/modifiers/intern/MOD_util.c @@ -235,7 +235,7 @@ Mesh *MOD_deform_mesh_eval_get(Object *ob, void MOD_get_vgroup( Object *ob, struct Mesh *mesh, const char *name, MDeformVert **dvert, int *defgrp_index) { - *defgrp_index = defgroup_name_index(ob, name); + *defgrp_index = BKE_object_defgroup_name_index(ob, name); *dvert = NULL; if (*defgrp_index != -1) { diff --git a/source/blender/modifiers/intern/MOD_uvwarp.c b/source/blender/modifiers/intern/MOD_uvwarp.c index 973923d1cf4..46298c0e00d 100644 --- a/source/blender/modifiers/intern/MOD_uvwarp.c +++ b/source/blender/modifiers/intern/MOD_uvwarp.c @@ -112,8 +112,8 @@ static void uv_warp_compute(void *__restrict userdata, for (l = 0; l < mp->totloop; l++, ml++, mluv++) { float uv[2]; const float weight = data->invert_vgroup ? - 1.0f - defvert_find_weight(&dvert[ml->v], defgrp_index) : - defvert_find_weight(&dvert[ml->v], defgrp_index); + 1.0f - BKE_defvert_find_weight(&dvert[ml->v], defgrp_index) : + BKE_defvert_find_weight(&dvert[ml->v], defgrp_index); uv_warp_from_mat4_pair(uv, mluv->uv, warp_mat); interp_v2_v2v2(mluv->uv, mluv->uv, uv, weight); diff --git a/source/blender/modifiers/intern/MOD_warp.c b/source/blender/modifiers/intern/MOD_warp.c index 57094d71522..8cfe6a17b01 100644 --- a/source/blender/modifiers/intern/MOD_warp.c +++ b/source/blender/modifiers/intern/MOD_warp.c @@ -235,8 +235,8 @@ static void warpModifier_do(WarpModifierData *wmd, /* skip if no vert group found */ if (defgrp_index != -1) { dv = &dvert[i]; - weight = invert_vgroup ? 1.0f - defvert_find_weight(dv, defgrp_index) * strength : - defvert_find_weight(dv, defgrp_index) * strength; + weight = invert_vgroup ? 1.0f - BKE_defvert_find_weight(dv, defgrp_index) * strength : + BKE_defvert_find_weight(dv, defgrp_index) * strength; if (weight <= 0.0f) { continue; } diff --git a/source/blender/modifiers/intern/MOD_wave.c b/source/blender/modifiers/intern/MOD_wave.c index ee4897bdefb..56b2a81fdb1 100644 --- a/source/blender/modifiers/intern/MOD_wave.c +++ b/source/blender/modifiers/intern/MOD_wave.c @@ -214,8 +214,8 @@ static void waveModifier_do(WaveModifierData *md, /* get weights */ if (dvert) { - def_weight = invert_group ? 1.0f - defvert_find_weight(&dvert[i], defgrp_index) : - defvert_find_weight(&dvert[i], defgrp_index); + def_weight = invert_group ? 1.0f - BKE_defvert_find_weight(&dvert[i], defgrp_index) : + BKE_defvert_find_weight(&dvert[i], defgrp_index); /* if this vert isn't in the vgroup, don't deform it */ if (def_weight == 0.0f) { diff --git a/source/blender/modifiers/intern/MOD_weighted_normal.c b/source/blender/modifiers/intern/MOD_weighted_normal.c index 1d6767a8077..d9c05d8d4b4 100644 --- a/source/blender/modifiers/intern/MOD_weighted_normal.c +++ b/source/blender/modifiers/intern/MOD_weighted_normal.c @@ -143,7 +143,7 @@ static void aggregate_item_normal(WeightedNormalModifierData *wnmd, const bool has_vgroup = dvert != NULL; const bool vert_of_group = has_vgroup && - defvert_find_index(&dvert[mv_index], defgrp_index) != NULL; + BKE_defvert_find_index(&dvert[mv_index], defgrp_index) != NULL; if (has_vgroup && ((vert_of_group && use_invert_vgroup) || (!vert_of_group && !use_invert_vgroup))) { diff --git a/source/blender/modifiers/intern/MOD_weightvg_util.c b/source/blender/modifiers/intern/MOD_weightvg_util.c index c63065eec40..e93ab608498 100644 --- a/source/blender/modifiers/intern/MOD_weightvg_util.c +++ b/source/blender/modifiers/intern/MOD_weightvg_util.c @@ -212,7 +212,7 @@ void weightvg_do_mask(const ModifierEvalContext *ctx, MEM_freeN(tex_co); } - else if ((ref_didx = defgroup_name_index(ob, defgrp_name)) != -1) { + else if ((ref_didx = BKE_object_defgroup_name_index(ob, defgrp_name)) != -1) { MDeformVert *dvert = NULL; /* Check whether we want to set vgroup weights from a constant weight factor or a vertex @@ -232,8 +232,8 @@ void weightvg_do_mask(const ModifierEvalContext *ctx, for (i = 0; i < num; i++) { int idx = indices ? indices[i] : i; const float f = invert_vgroup_mask ? - 1.0f - defvert_find_weight(&dvert[idx], ref_didx) * fact : - defvert_find_weight(&dvert[idx], ref_didx) * fact; + 1.0f - BKE_defvert_find_weight(&dvert[idx], ref_didx) * fact : + BKE_defvert_find_weight(&dvert[idx], ref_didx) * fact; org_w[i] = (new_w[i] * f) + (org_w[i] * (1.0f - f)); /* If that vertex is not in ref vgroup, assume null factor, and hence do nothing! */ } @@ -271,7 +271,7 @@ void weightvg_update_vg(MDeformVert *dvert, float w = weights[i]; MDeformVert *dv = &dvert[indices ? indices[i] : i]; MDeformWeight *dw = dws ? dws[i] : - ((defgrp_idx >= 0) ? defvert_find_index(dv, defgrp_idx) : NULL); + ((defgrp_idx >= 0) ? BKE_defvert_find_index(dv, defgrp_idx) : NULL); /* Never allow weights out of [0.0, 1.0] range. */ CLAMP(w, 0.0f, 1.0f); @@ -279,7 +279,7 @@ void weightvg_update_vg(MDeformVert *dvert, /* If the vertex is in this vgroup, remove it if needed, or just update it. */ if (dw != NULL) { if (do_rem && w < rem_thresh) { - defvert_remove_group(dv, dw); + BKE_defvert_remove_group(dv, dw); } else { dw->weight = w; @@ -287,7 +287,7 @@ void weightvg_update_vg(MDeformVert *dvert, } /* Else, add it if needed! */ else if (do_add && w > add_thresh) { - defvert_add_index_notest(dv, defgrp_idx, w); + BKE_defvert_add_index_notest(dv, defgrp_idx, w); } } } diff --git a/source/blender/modifiers/intern/MOD_weightvgedit.c b/source/blender/modifiers/intern/MOD_weightvgedit.c index e05484a1ec4..f914d05dbcd 100644 --- a/source/blender/modifiers/intern/MOD_weightvgedit.c +++ b/source/blender/modifiers/intern/MOD_weightvgedit.c @@ -188,7 +188,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes } /* Get vgroup idx from its name. */ - const int defgrp_index = defgroup_name_index(ctx->object, wmd->defgrp_name); + const int defgrp_index = BKE_object_defgroup_name_index(ctx->object, wmd->defgrp_name); if (defgrp_index == -1) { return mesh; } @@ -220,7 +220,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes new_w = MEM_malloc_arrayN(numVerts, sizeof(float), "WeightVGEdit Modifier, new_w"); dw = MEM_malloc_arrayN(numVerts, sizeof(MDeformWeight *), "WeightVGEdit Modifier, dw"); for (i = 0; i < numVerts; i++) { - dw[i] = defvert_find_index(&dvert[i], defgrp_index); + dw[i] = BKE_defvert_find_index(&dvert[i], defgrp_index); if (dw[i]) { org_w[i] = new_w[i] = dw[i]->weight; } diff --git a/source/blender/modifiers/intern/MOD_weightvgmix.c b/source/blender/modifiers/intern/MOD_weightvgmix.c index 71feaccef45..4aaa69912b2 100644 --- a/source/blender/modifiers/intern/MOD_weightvgmix.c +++ b/source/blender/modifiers/intern/MOD_weightvgmix.c @@ -235,14 +235,14 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes } /* Get vgroup idx from its name. */ - const int defgrp_index = defgroup_name_index(ctx->object, wmd->defgrp_name_a); + const int defgrp_index = BKE_object_defgroup_name_index(ctx->object, wmd->defgrp_name_a); if (defgrp_index == -1) { return mesh; } /* Get second vgroup idx from its name, if given. */ int defgrp_index_other = -1; if (wmd->defgrp_name_b[0] != '\0') { - defgrp_index_other = defgroup_name_index(ctx->object, wmd->defgrp_name_b); + defgrp_index_other = BKE_object_defgroup_name_index(ctx->object, wmd->defgrp_name_b); if (defgrp_index_other == -1) { return mesh; } @@ -278,11 +278,11 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes case MOD_WVG_SET_A: /* All vertices in first vgroup. */ for (i = 0; i < numVerts; i++) { - MDeformWeight *dw = defvert_find_index(&dvert[i], defgrp_index); + MDeformWeight *dw = BKE_defvert_find_index(&dvert[i], defgrp_index); if (dw) { tdw1[numIdx] = dw; tdw2[numIdx] = (defgrp_index_other >= 0) ? - defvert_find_index(&dvert[i], defgrp_index_other) : + BKE_defvert_find_index(&dvert[i], defgrp_index_other) : NULL; tidx[numIdx++] = i; } @@ -292,10 +292,10 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes /* All vertices in second vgroup. */ for (i = 0; i < numVerts; i++) { MDeformWeight *dw = (defgrp_index_other >= 0) ? - defvert_find_index(&dvert[i], defgrp_index_other) : + BKE_defvert_find_index(&dvert[i], defgrp_index_other) : NULL; if (dw) { - tdw1[numIdx] = defvert_find_index(&dvert[i], defgrp_index); + tdw1[numIdx] = BKE_defvert_find_index(&dvert[i], defgrp_index); tdw2[numIdx] = dw; tidx[numIdx++] = i; } @@ -304,9 +304,9 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes case MOD_WVG_SET_OR: /* All vertices in one vgroup or the other. */ for (i = 0; i < numVerts; i++) { - MDeformWeight *adw = defvert_find_index(&dvert[i], defgrp_index); + MDeformWeight *adw = BKE_defvert_find_index(&dvert[i], defgrp_index); MDeformWeight *bdw = (defgrp_index_other >= 0) ? - defvert_find_index(&dvert[i], defgrp_index_other) : + BKE_defvert_find_index(&dvert[i], defgrp_index_other) : NULL; if (adw || bdw) { tdw1[numIdx] = adw; @@ -318,9 +318,9 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes case MOD_WVG_SET_AND: /* All vertices in both vgroups. */ for (i = 0; i < numVerts; i++) { - MDeformWeight *adw = defvert_find_index(&dvert[i], defgrp_index); + MDeformWeight *adw = BKE_defvert_find_index(&dvert[i], defgrp_index); MDeformWeight *bdw = (defgrp_index_other >= 0) ? - defvert_find_index(&dvert[i], defgrp_index_other) : + BKE_defvert_find_index(&dvert[i], defgrp_index_other) : NULL; if (adw && bdw) { tdw1[numIdx] = adw; @@ -333,9 +333,10 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes default: /* Use all vertices. */ for (i = 0; i < numVerts; i++) { - tdw1[i] = defvert_find_index(&dvert[i], defgrp_index); - tdw2[i] = (defgrp_index_other >= 0) ? defvert_find_index(&dvert[i], defgrp_index_other) : - NULL; + tdw1[i] = BKE_defvert_find_index(&dvert[i], defgrp_index); + tdw2[i] = (defgrp_index_other >= 0) ? + BKE_defvert_find_index(&dvert[i], defgrp_index_other) : + NULL; } numIdx = -1; break; diff --git a/source/blender/modifiers/intern/MOD_weightvgproximity.c b/source/blender/modifiers/intern/MOD_weightvgproximity.c index 56156a07f61..9403c2a837b 100644 --- a/source/blender/modifiers/intern/MOD_weightvgproximity.c +++ b/source/blender/modifiers/intern/MOD_weightvgproximity.c @@ -439,7 +439,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes } /* Get vgroup idx from its name. */ - defgrp_index = defgroup_name_index(ob, wmd->defgrp_name); + defgrp_index = BKE_object_defgroup_name_index(ob, wmd->defgrp_name); if (defgrp_index == -1) { return mesh; } @@ -463,7 +463,7 @@ static Mesh *applyModifier(ModifierData *md, const ModifierEvalContext *ctx, Mes tw = MEM_malloc_arrayN(numVerts, sizeof(float), "WeightVGProximity Modifier, tw"); tdw = MEM_malloc_arrayN(numVerts, sizeof(MDeformWeight *), "WeightVGProximity Modifier, tdw"); for (i = 0; i < numVerts; i++) { - MDeformWeight *_dw = defvert_find_index(&dvert[i], defgrp_index); + MDeformWeight *_dw = BKE_defvert_find_index(&dvert[i], defgrp_index); if (_dw) { tidx[numIdx] = i; tw[numIdx] = _dw->weight; diff --git a/source/blender/modifiers/intern/MOD_weld.c b/source/blender/modifiers/intern/MOD_weld.c index 803c8e1853f..f12162f9173 100644 --- a/source/blender/modifiers/intern/MOD_weld.c +++ b/source/blender/modifiers/intern/MOD_weld.c @@ -1629,7 +1629,7 @@ static Mesh *weldModifier_doWeld(WeldModifierData *wmd, const ModifierEvalContex totvert = mesh->totvert; /* Vertex Group. */ - const int defgrp_index = defgroup_name_index(ob, wmd->defgrp_name); + const int defgrp_index = BKE_object_defgroup_name_index(ob, wmd->defgrp_name); if (defgrp_index != -1) { MDeformVert *dvert, *dv; dvert = CustomData_get_layer(&mesh->vdata, CD_MDEFORMVERT); @@ -1638,7 +1638,7 @@ static Mesh *weldModifier_doWeld(WeldModifierData *wmd, const ModifierEvalContex dv = &dvert[0]; v_mask = BLI_BITMAP_NEW(totvert, __func__); for (i = 0; i < totvert; i++, dv++) { - const bool found = defvert_find_weight(dv, defgrp_index) > 0.0f; + const bool found = BKE_defvert_find_weight(dv, defgrp_index) > 0.0f; if (found != invert_vgroup) { BLI_BITMAP_ENABLE(v_mask, i); v_mask_act++; diff --git a/source/blender/modifiers/intern/MOD_wireframe.c b/source/blender/modifiers/intern/MOD_wireframe.c index 3dd6e00c3a5..04473b30585 100644 --- a/source/blender/modifiers/intern/MOD_wireframe.c +++ b/source/blender/modifiers/intern/MOD_wireframe.c @@ -61,7 +61,7 @@ static Mesh *WireframeModifier_do(WireframeModifierData *wmd, Object *ob, Mesh * Mesh *result; BMesh *bm; - const int defgrp_index = defgroup_name_index(ob, wmd->defgrp_name); + const int defgrp_index = BKE_object_defgroup_name_index(ob, wmd->defgrp_name); bm = BKE_mesh_to_bmesh_ex(mesh, &(struct BMeshCreateParams){0}, |