FIX #110946: vgroup normalize all check if armature is deforming before normalizing #112648
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#112648
Loading…
Reference in New Issue
No description provided.
Delete Branch "nrupsis/blender:110946-Normalize-V-Groups-Armature-Mod-Hidden"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The issue in #110946 is if an armature is present, but not active the group_select_mode defaults to WT_VGROUP_BONE_DEFORM, and throws an error because it can't find any active vertex groups.
To fix this, we're now checking to see if any bone is actively deforming before switching toWT_VGROUP_BONE_DEFORM (else defaulting to WT_VGROUP_ALL)
@ -2897,2 +2895,2 @@
"group_select_mode",
BKE_modifiers_is_deformed_by_armature(ob) ? WT_VGROUP_BONE_DEFORM : WT_VGROUP_ALL);
/* Default to All Groups. */
eVGroupSelect targetGroup = WT_VGROUP_ALL;
This functionality is at a different abstraction level than the surrounding code. Because of that, I think it's better to put it into a little
static
function of its own that returns eitherWT_VGROUP_BONE_DEFORM
orWT_VGROUP_ALL
.That's a good call, and the reason this is still a WIP. It's a bit ugly at the moment.
WIP: FIX #110946: vgroup normalize all check if armature is deforming before normalizingto FIX #110946: vgroup normalize all check if armature is deforming before normalizing@blender-bot package
Package build started. Download here when ready.
Thanks, I can confirm this fixes things :)
Please rebase this PR onto the
blender-v4.0-release
branch. This takes two steps:main
but onto the release branch.More info on https://wiki.blender.org/wiki/Process/Using_Stabilizing_Branch
@ -2891,0 +2901,4 @@
if (BKE_modifiers_is_deformed_by_armature(ob)) {
bool *defgroup_validmap = nullptr;
int r_defgroup_tot = BKE_object_defgroup_count(ob);
r_defgroup_tot
is not used as a return parameter anywhere, so remove ther_
prefix and make itconst
.@ -2891,0 +2903,4 @@
int r_defgroup_tot = BKE_object_defgroup_count(ob);
defgroup_validmap = BKE_object_defgroup_validmap_get(ob, r_defgroup_tot);
I think these three lines are tightly related, so better to remove the newlines between them. Also it shows that
defgroup_validmap
is not used between its initialisation tonullptr
and its later assignment, so you can shorten it further to:@ -2891,0 +2906,4 @@
defgroup_validmap = BKE_object_defgroup_validmap_get(ob, r_defgroup_tot);
for (int i = 0; i < r_defgroup_tot; i++) {
if (defgroup_validmap[i] == true) {
Usually I'm not a fan of
== true
, but here it kinda helps to drive the point home that this is a boolean array.FIX #110946: vgroup normalize all check if armature is deforming before normalizingto FIX #110946: vgroup normalize all check if armature is deforming before normalizing0d6121e346
toa286b90ff8
Looks like I switched the PR target before the rebase took effect 😬 sorry for the clutter.
No fuss, that happens.
The patch works like a charm! Thanks :)