Stretch To constraints are broken on file reopening #127017
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 & 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
Asset System
Module
Core
Module
Development Management
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline & 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
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#127017
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
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?
TL;DR:
Since validity of the constraints can change depending on the values of their ID pointers (e.g. targets), the remapping code needs to "somehow' update/re-check the constraints as part of its post-process updates.
Currently this happens in
editor
code area, when e.g. targets or other properties are edited (mainly through RNA and the property update callback system).Proposed Solution
constraint_tag_update
and whole related code into BKE.libblock_remap_data_postprocess_obdata_relink
one, to callconstraint_tag_update
.constraint_tag_update
function - to be confirmed.a. Split constraint check/updates into two steps, an efficient and simple call to mark current status as dirty, and an actual 'ensure valid' code path only called 'when needed'.
b. 'foreach id' handler for constraints checks if old and new ID are different, and accordingly tag the constraint as dirty, and the object as needing constraints status updates.
Technical Details of the Issue
The constraints in liboverride data are marked as valid, and therefore evaluated, while they should be invalid (and not evaluated). Here is what happens when applying liboverrides:
constraint_tag_update
, which finds that the owner ID and the target ID are currently different, so it considers the constraint as valid.Original Report:
System Information
Operating system: Linux
Graphics card: AMD Radeon RX 5600
Blender Version
Broken: Blender 4.2.1 LTS,
396f546c9d
, 2024-08-20Worked: None
Short description of error
Stretch To constraints on linked armatures are broken on file reopening.
Exact steps for others to reproduce the error
This issue was originally discussed as an issue with the Human Generator addon (https://github.com/OliverJPost/HumGen3D/issues/110), however it doesn't seem to be the fault of the addon. The model and rig included in the file is the output of the Human Generator 3D addon, but I've verified that the problem happens without the addon being present in the system (and the included blend should contain no references to the addon).
The steps required are as follows:
Create a new blend and delete all objects, leaving only the Scene Collection.
Link following objects in the attached
BlenderLibraryOverrideBug.blend
file into the new blend:Jeffery_RIGIFY
,HG_Body
,HG_Eyes
,HG_TeethLower
,HG_TeethUpper
Select the
Jeffery_RIGIFY
armature, andMake library override
.Save the file and reopen it.
You'll be greeted with the horrors in the image:
https://ataxia.io7m.com/2024/08/31/stretch.png
It makes an artistic statement, but it's not really what I wanted.
Hi, thanks for the report. Can confirm after library override. AFAICS,
HG_Eyes
object's mesh data is corrupted (I ranmesh.validate()
).Apart from that, resyncing library override resolves the issue for an instance.
Not sure if this is a blender bug or somewhere in mesh/rig or corrupted data. @mont29 any idea?
Analyzing a complete production rig is not really an option. Do you happen to know which constraint/bone is failing? Or can you reproduce the issue with a simple set-up (e.g. by taking current asset, and removing bones until you cannot reproduce the issue).
I listed all of the bones that have
Stretch To
constraints on them, and went down the list one at a time turning the influence on and off to see which bones caused the damage above.It seems that these two bones cause all of the issues (at least to my eyes):
Interestingly, just touching the influence control fixes the problem. It doesn't matter what the influence is set to afterwards. I can't see anything that would make these two bones special. To reiterate; I didn't create the rig, so unfortunately I don't know or understand how it's constructed. I might be able to get some input from the author of the addon.
Thanks, that sounds like an update issue then... checking.
Can confirm the issues.
In fact, with this heavily simplified file, most of the
ORG
bones get invalid transform after re-opening the file containing a liboverride of the rig. As if evaluation was not happening, or was happening with invalid data or at the wrong time. I did check, all the RNA update code seems to be called as expected, with proper depsgraph tagging, so... quite puzzled with this one currently.Finally understood the problem. The root of the issue is that these StretchTo constraints are invalid (they target the owner object (the rig), but with no bone target).
Note that the problem could also arise in many other circumstances, and is not intrisically related to liboverrides, but rather to our id remapping code.
I updated the description of the task with details about the problem and a proposed way to solve it.
I cannot tackle that in the coming days, and will need input from the Animation team anyway.
CC @dr.sybren
I'm not sure what the status of this is now.
Is there any workaround? Presumably "manipulate every bone every time you open the file".
@io7m the immediate work-around is to mute or fix your StretchTo constraints (to be valid, they should either target another object, or have an additional bone sub-target).
OK, thanks. I've reported this back to the HG author, but I've no idea if he's read any of this.