diff options
author | Alexander Gavrilov <angavrilov@gmail.com> | 2018-10-07 18:25:51 +0300 |
---|---|---|
committer | Alexander Gavrilov <angavrilov@gmail.com> | 2020-03-18 11:55:44 +0300 |
commit | 084bf7daee3ebcd57696f5b2a0c83db1b1f3d472 (patch) | |
tree | e5f37d2e47d11a23730d90afb60f7cac633e0f8c /source/blender/blenkernel/BKE_deform.h | |
parent | 82c51d0edbab45f014b4d0b4c0a96c000c46e232 (diff) |
Weight Paint: Implement a new Lock-Relative mode.
This check box alters how weights are displayed and painted,
similar to Multi Paint, but in a different way. Specifically,
weights are presented as if all locked vertex groups were
deleted, and the remaining deform groups normalized.
The new feature is intended for use when balancing weights within
a group of bones while all others are locked. Enabling the option
presents weight as if the locked bones didn't exist, and their
weight was proportionally redistributed to the editable bones.
Conversely, the Multi-Paint feature allows balancing a group of
bones as a whole against all unselected bones, while ignoring
weight distribution within the selected group.
This mode also allows temporarily viewing non-normalized weights
as if they were normalized, without actually changing the values.
Differential Revision: https://developer.blender.org/D3837
Diffstat (limited to 'source/blender/blenkernel/BKE_deform.h')
-rw-r--r-- | source/blender/blenkernel/BKE_deform.h | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_deform.h b/source/blender/blenkernel/BKE_deform.h index cdfbd45bb5f..c86b877b575 100644 --- a/source/blender/blenkernel/BKE_deform.h +++ b/source/blender/blenkernel/BKE_deform.h @@ -67,11 +67,24 @@ float BKE_defvert_array_find_weight_safe(const struct MDeformVert *dvert, const int index, const int defgroup); +float BKE_defvert_total_selected_weight(const struct MDeformVert *dv, + int defbase_tot, + const bool *defbase_sel); + float BKE_defvert_multipaint_collective_weight(const struct MDeformVert *dv, int defbase_tot, const bool *defbase_sel, int defbase_tot_sel, - bool do_autonormalize); + bool is_normalized); + +float BKE_defvert_calc_lock_relative_weight(float weight, + float locked_weight, + float unlocked_weight); +float BKE_defvert_lock_relative_weight(float weight, + const struct MDeformVert *dv, + int defbase_tot, + const bool *defbase_locked, + const bool *defbase_unlocked); void BKE_defvert_copy(struct MDeformVert *dvert_dst, const struct MDeformVert *dvert_src); void BKE_defvert_copy_subset(struct MDeformVert *dvert_dst, |