Fix #147009: Anim: Normalize All fails when all groups are unlocked
When all vertex groups are *unlocked* and the Normalize All operator is run with "Lock Active" disabled, the operator would fail with the patently false error message "All groups are locked". The cause was that: 1. When all vertex groups are unlocked, the lock flags array used internally would be left empty, with the idea that a non-existent flag indicates "unlocked". 2. The code that determined if all groups were locked was checking if any of those flags were "unlocked". 3. In an empty array, of course no items are "unlocked", and thus it would think all items are locked. The fix in this PR is to also check if the flag array is empty when determining if all groups are locked. Pull Request: https://projects.blender.org/blender/blender/pulls/147272
This commit is contained in:
committed by
Nathan Vegdahl
parent
e6f1cd6a29
commit
af63d06739
@@ -1430,7 +1430,7 @@ static bool vgroup_normalize_all(Object *ob,
|
||||
soft_lock_flags[def_nr] = true;
|
||||
}
|
||||
|
||||
const bool all_locked = !lock_flags.contains(false);
|
||||
const bool all_locked = !lock_flags.is_empty() && !lock_flags.contains(false);
|
||||
if (all_locked) {
|
||||
BKE_report(reports, RPT_ERROR, "All groups are locked");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user