Fix #129094: Sub-targets not symmetrized if from different armature #129169
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Code Documentation
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
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
Viewport & EEVEE
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Asset Browser Project
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
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
Module
Viewport & EEVEE
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Severity
High
Severity
Low
Severity
Normal
Severity
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
2 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#129169
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "ChrisLend/blender:fix_symmetrize_constraint_targets"
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?
When symmetrizing a bone (in edit mode) any constraint subtargets were name flipped,
if possible and they exist. This only worked if the target is the armature of the bone
being flipped.
This patch changes that so a subtarget flip is always attempted for targets that are an armature.
It would seem that there's now a chance that the same constraint may get flipped twice?
Before:
updateDuplicateSubtarget()
ensured that the flipping either happens when the subtarget is also flipped OR whenlookup_mirror_subtarget
istrue
.After: if the subtarget bone is also flipped itself, both
updateDuplicateSubtarget()
andmirror_pose_bone()
might flip the constraint subtarget.Depending on the order of the calls, this may or may not be a problem.
updateDuplicateSubtarget()
will work fine regardless of the call order, butmirror_pose_bone()
will always flip, so if it is called afterupdateDuplicateSubtarget()
, the flipping might happen twice.To me this feels a bit fragile, as there now seem to be two code paths in different functions that effectively do the same thing but differently.
I think it would be good to have a few test cases in a unit test, to cover the various use cases for this operator.
@ -987,0 +974,4 @@
LISTBASE_FOREACH (bConstraint *, constraint, &pose_bone->constraints) {
ListBase targets = {nullptr, nullptr};
BKE_constraint_targets_get(constraint, &targets);
char name_flip[MAX_ID_NAME - 2];
I think
name_flipped
would be a better name for this variable.well I wrote a test, then realized there is one already in
bl_rigging_symmetrize
The issue is that it's too generic and checks for equality on constraint variables which isn't always valid.
Will have to rewrite that a bit because those are of course broken now
@blender-bot build
I undid what I had done before. Now I just extended the existing function to use the bones of the target, instead of relying on an edit bone list that is passed in.
Also I added a unit test to explicitly test against symmetrizing of subtargets on different armatures
LGTM, just one minor thing that can be handled when landing.
@ -417,3 +419,2 @@
}
oldtarget = get_named_editbone(editbones, ct->subtarget);
if (!oldtarget) {
Object *target = ct->tar;
Because
oldtarget
andnewtarget
are already variables, and they reference a bone, I feel that usingtarget
here is a bit confusing. Since there is no casting involved either, I think it's fine to either just keep repeatingct->tar
(the compiler will likely optimise anyway) or name this variabletarget_ob
or something.renamed to
target_ob
I like to have it as a variable because
ct->tar
is just really cryptic