Fix misleading field naming.

This is not any kind of length, it is the number of true values.
This commit is contained in:
Alexander Gavrilov 2018-09-26 08:57:04 +03:00
parent f5c4cc877e
commit bb8023ff7f
4 changed files with 9 additions and 9 deletions

View File

@ -43,7 +43,7 @@
* - Operators:
* +, -, *, /, ==, !=, <, <=, >, >=, and, or, not, ternary if
* - Functions:
* radians, degrees,
* min, max, radians, degrees,
* abs, fabs, floor, ceil, trunc, int,
* sin, cos, tan, asin, acos, atan, atan2,
* exp, log, sqrt, pow, fmod

View File

@ -2973,19 +2973,19 @@ GPUBatch *DRW_cache_mesh_surface_weights_get(Object *ob, ToolSettings *ts, bool
if (paint_mode && ts->multipaint) {
/* Multipaint needs to know all selected bones, not just the active group.
* This is actually a relatively expensive operation, but caching would be difficult. */
wstate.defgroup_sel = BKE_object_defgroup_selected_get(ob, wstate.defgroup_len, &wstate.defgroup_sel_len);
wstate.defgroup_sel = BKE_object_defgroup_selected_get(ob, wstate.defgroup_len, &wstate.defgroup_sel_count);
if (wstate.defgroup_sel_len > 1) {
if (wstate.defgroup_sel_count > 1) {
wstate.flags |= DRW_MESH_WEIGHT_STATE_MULTIPAINT | (ts->auto_normalize ? DRW_MESH_WEIGHT_STATE_AUTO_NORMALIZE : 0);
if (me->editflag & ME_EDIT_MIRROR_X) {
BKE_object_defgroup_mirror_selection(
ob, wstate.defgroup_len, wstate.defgroup_sel, wstate.defgroup_sel, &wstate.defgroup_sel_len);
ob, wstate.defgroup_len, wstate.defgroup_sel, wstate.defgroup_sel, &wstate.defgroup_sel_count);
}
}
/* With only one selected bone Multipaint reverts to regular mode. */
else {
wstate.defgroup_sel_len = 0;
wstate.defgroup_sel_count = 0;
MEM_SAFE_FREE(wstate.defgroup_sel);
}
}

View File

@ -105,8 +105,8 @@ struct DRW_MeshWeightState {
char alert_mode;
/* Set of all selected bones for Multipaint. */
bool *defgroup_sel;
int defgroup_sel_len;
bool *defgroup_sel; /* [defgroup_len] */
int defgroup_sel_count;
};
/* DRW_MeshWeightState.flags */

View File

@ -1127,7 +1127,7 @@ static void evaluate_vertex_weight(float vweight[3], const MDeformVert *dvert, c
if (wstate->flags & DRW_MESH_WEIGHT_STATE_MULTIPAINT) {
/* Multi-Paint feature */
input = BKE_defvert_multipaint_collective_weight(
dvert, wstate->defgroup_len, wstate->defgroup_sel, wstate->defgroup_sel_len,
dvert, wstate->defgroup_len, wstate->defgroup_sel, wstate->defgroup_sel_count,
(wstate->flags & DRW_MESH_WEIGHT_STATE_AUTO_NORMALIZE) != 0);
/* make it black if the selected groups have no weight on a vertex */
@ -1624,7 +1624,7 @@ bool DRW_mesh_weight_state_compare(const struct DRW_MeshWeightState *a, const st
a->defgroup_len == b->defgroup_len &&
a->flags == b->flags &&
a->alert_mode == b->alert_mode &&
a->defgroup_sel_len == b->defgroup_sel_len &&
a->defgroup_sel_count == b->defgroup_sel_count &&
((!a->defgroup_sel && !b->defgroup_sel) ||
(a->defgroup_sel && b->defgroup_sel &&
memcmp(a->defgroup_sel, b->defgroup_sel, a->defgroup_len * sizeof(bool)) == 0));