Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-03-06 04:50:56 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-03-06 04:56:44 +0300
commitbba4a09b2f0b73f0a38e1eccc403a4cef536f703 (patch)
tree4fcd36e2643a2e4d476d3bcf00c346e7ac81c642 /source/blender/editors/sculpt_paint
parent1af83aa2dd895ca0e6e7a31d64c19ef4d3241298 (diff)
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.
Diffstat (limited to 'source/blender/editors/sculpt_paint')
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex.c16
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex_color_ops.c2
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c24
-rw-r--r--source/blender/editors/sculpt_paint/paint_vertex_weight_utils.c6
4 files changed, 24 insertions, 24 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_vertex.c b/source/blender/editors/sculpt_paint/paint_vertex.c
index 6e96b9acca5..9634f6bacd2 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex.c
@@ -172,7 +172,7 @@ static MDeformVert *defweight_prev_init(MDeformVert *dvert_prev,
MDeformVert *dv_prev = &dvert_prev[index];
if (dv_prev->flag == 1) {
dv_prev->flag = 0;
- defvert_copy(dv_prev, dv_curr);
+ BKE_defvert_copy(dv_prev, dv_curr);
}
return dv_prev;
}
@@ -752,10 +752,10 @@ static void do_weight_paint_vertex_single(
}
if (wp->flag & VP_FLAG_VGROUP_RESTRICT) {
- dw = defvert_find_index(dv, wpi->active.index);
+ dw = BKE_defvert_find_index(dv, wpi->active.index);
}
else {
- dw = defvert_verify_index(dv, wpi->active.index);
+ dw = BKE_defvert_ensure_index(dv, wpi->active.index);
}
if (dw == NULL) {
@@ -766,7 +766,7 @@ static void do_weight_paint_vertex_single(
if (index_mirr != -1) {
dv_mirr = &me->dvert[index_mirr];
if (wp->flag & VP_FLAG_VGROUP_RESTRICT) {
- dw_mirr = defvert_find_index(dv_mirr, vgroup_mirr);
+ dw_mirr = BKE_defvert_find_index(dv_mirr, vgroup_mirr);
if (dw_mirr == NULL) {
index_mirr = vgroup_mirr = -1;
@@ -775,13 +775,13 @@ static void do_weight_paint_vertex_single(
}
else {
if (index != index_mirr) {
- dw_mirr = defvert_verify_index(dv_mirr, vgroup_mirr);
+ dw_mirr = BKE_defvert_ensure_index(dv_mirr, vgroup_mirr);
}
else {
/* dv and dv_mirr are the same */
int totweight_prev = dv_mirr->totweight;
int dw_offset = (int)(dw - dv_mirr->dw);
- dw_mirr = defvert_verify_index(dv_mirr, vgroup_mirr);
+ dw_mirr = BKE_defvert_ensure_index(dv_mirr, vgroup_mirr);
/* if we added another, get our old one back */
if (totweight_prev != dv_mirr->totweight) {
@@ -802,7 +802,7 @@ static void do_weight_paint_vertex_single(
defweight_prev_init(dvert_prev, me->dvert, index_mirr);
}
- weight_prev = defvert_find_weight(dv_prev, wpi->active.index);
+ weight_prev = BKE_defvert_find_weight(dv_prev, wpi->active.index);
}
else {
weight_prev = dw->weight;
@@ -1694,7 +1694,7 @@ static float wpaint_get_active_weight(const MDeformVert *dv, const WeightPaintIn
return weight;
}
else {
- return defvert_find_weight(dv, wpi->active.index);
+ return BKE_defvert_find_weight(dv, wpi->active.index);
}
}
diff --git a/source/blender/editors/sculpt_paint/paint_vertex_color_ops.c b/source/blender/editors/sculpt_paint/paint_vertex_color_ops.c
index 266c130d12a..3a4c8f20028 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex_color_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex_color_ops.c
@@ -160,7 +160,7 @@ static bool vertex_paint_from_weight(Object *ob)
uint j = 0;
do {
uint vidx = me->mloop[mp->loopstart + j].v;
- const float weight = defvert_find_weight(&me->dvert[vidx], vgroup_active);
+ const float weight = BKE_defvert_find_weight(&me->dvert[vidx], vgroup_active);
const uchar grayscale = weight * 255;
lcol->r = grayscale;
lcol->b = grayscale;
diff --git a/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c b/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c
index ae4ef59597b..0d4fcd3e87d 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c
@@ -211,7 +211,7 @@ static int weight_sample_invoke(bContext *C, wmOperator *op, const wmEvent *even
ToolSettings *ts = vc.scene->toolsettings;
Brush *brush = BKE_paint_brush(&ts->wpaint->paint);
const int vgroup_active = vc.obact->actdef - 1;
- float vgroup_weight = defvert_find_weight(&me->dvert[v_idx_best], vgroup_active);
+ float vgroup_weight = BKE_defvert_find_weight(&me->dvert[v_idx_best], vgroup_active);
/* use combined weight in multipaint mode,
* since that's what is displayed to the user in the colors */
@@ -462,9 +462,9 @@ static bool weight_paint_set(Object *ob, float paintweight)
continue;
}
- dw = defvert_verify_index(&me->dvert[vidx], vgroup_active);
+ dw = BKE_defvert_ensure_index(&me->dvert[vidx], vgroup_active);
if (dw) {
- dw_prev = defvert_verify_index(wpp.wpaint_prev + vidx, vgroup_active);
+ dw_prev = BKE_defvert_ensure_index(wpp.wpaint_prev + vidx, vgroup_active);
dw_prev->weight = dw->weight; /* set the undo weight */
dw->weight = paintweight;
@@ -473,12 +473,12 @@ static bool weight_paint_set(Object *ob, float paintweight)
if (j >= 0) {
/* copy, not paint again */
if (vgroup_mirror != -1) {
- dw = defvert_verify_index(me->dvert + j, vgroup_mirror);
- dw_prev = defvert_verify_index(wpp.wpaint_prev + j, vgroup_mirror);
+ dw = BKE_defvert_ensure_index(me->dvert + j, vgroup_mirror);
+ dw_prev = BKE_defvert_ensure_index(wpp.wpaint_prev + j, vgroup_mirror);
}
else {
- dw = defvert_verify_index(me->dvert + j, vgroup_active);
- dw_prev = defvert_verify_index(wpp.wpaint_prev + j, vgroup_active);
+ dw = BKE_defvert_ensure_index(me->dvert + j, vgroup_active);
+ dw_prev = BKE_defvert_ensure_index(wpp.wpaint_prev + j, vgroup_active);
}
dw_prev->weight = dw->weight; /* set the undo weight */
dw->weight = paintweight;
@@ -602,7 +602,7 @@ static void gradientVert_update(WPGradient_userData *grad_data, int index)
if (alpha != 0.0f) {
MDeformVert *dv = &me->dvert[index];
- MDeformWeight *dw = defvert_verify_index(dv, grad_data->def_nr);
+ MDeformWeight *dw = BKE_defvert_ensure_index(dv, grad_data->def_nr);
// dw->weight = alpha; // testing
int tool = grad_data->brush->blend;
float testw;
@@ -617,14 +617,14 @@ static void gradientVert_update(WPGradient_userData *grad_data, int index)
MDeformVert *dv = &me->dvert[index];
if (vs->flag & VGRAD_STORE_DW_EXIST) {
/* normally we NULL check, but in this case we know it exists */
- MDeformWeight *dw = defvert_find_index(dv, grad_data->def_nr);
+ MDeformWeight *dw = BKE_defvert_find_index(dv, grad_data->def_nr);
dw->weight = vs->weight_orig;
}
else {
/* wasn't originally existing, remove */
- MDeformWeight *dw = defvert_find_index(dv, grad_data->def_nr);
+ MDeformWeight *dw = BKE_defvert_find_index(dv, grad_data->def_nr);
if (dw) {
- defvert_remove_group(dv, dw);
+ BKE_defvert_remove_group(dv, dw);
}
}
}
@@ -678,7 +678,7 @@ static void gradientVertInit__mapFunc(void *userData,
}
MDeformVert *dv = &me->dvert[index];
- const MDeformWeight *dw = defvert_find_index(dv, grad_data->def_nr);
+ const MDeformWeight *dw = BKE_defvert_find_index(dv, grad_data->def_nr);
if (dw) {
vs->weight_orig = dw->weight;
vs->flag = VGRAD_STORE_DW_EXIST;
diff --git a/source/blender/editors/sculpt_paint/paint_vertex_weight_utils.c b/source/blender/editors/sculpt_paint/paint_vertex_weight_utils.c
index 28699b45add..517bb6324be 100644
--- a/source/blender/editors/sculpt_paint/paint_vertex_weight_utils.c
+++ b/source/blender/editors/sculpt_paint/paint_vertex_weight_utils.c
@@ -88,7 +88,7 @@ bool ED_wpaint_ensure_data(bContext *C,
bPoseChannel *pchan = BKE_pose_channel_find_name(modob->pose, actbone->name);
if (pchan) {
- bDeformGroup *dg = defgroup_find_name(ob, pchan->name);
+ bDeformGroup *dg = BKE_object_defgroup_find_name(ob, pchan->name);
if (dg == NULL) {
dg = BKE_object_defgroup_add_name(ob, pchan->name); /* sets actdef */
DEG_relations_tag_update(CTX_data_main(C));
@@ -140,9 +140,9 @@ int ED_wpaint_mirror_vgroup_ensure(Object *ob, const int vgroup_active)
char name_flip[MAXBONENAME];
BLI_string_flip_side_name(name_flip, defgroup->name, false, sizeof(name_flip));
- mirrdef = defgroup_name_index(ob, name_flip);
+ mirrdef = BKE_object_defgroup_name_index(ob, name_flip);
if (mirrdef == -1) {
- if (BKE_defgroup_new(ob, name_flip)) {
+ if (BKE_object_defgroup_new(ob, name_flip)) {
mirrdef = BLI_listbase_count(&ob->defbase) - 1;
}
}