Bone collections and bone collection membership are not handled properly when undoing in armature edit mode #111780
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset System
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
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
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#111780
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?
Blender Version
Broken:
998136f7a7
Short description of error
When you undo in armature edit mode, all bones lose their bone collection memberships, and adding/removing bone collections is not undone.
Exact steps for others to reproduce the error
This is due to bone collections not being handled at all in the armature undo code.
In order to initially land bone collections, I added the following code as a stop-gap to avoid crashes due to accessing invalid memory:
It does indeed eliminate the crashes, but also causes undo to work incorrectly. To fix this issue, that code must be removed, and all crashes and misbehavior resulting from that need to be addressed.
Further investigation into the crashes revealed that there are multiple underlying issues, any of which can cause crashes:
editors/armature/editarmature_undo.cc
copies the edit bones to the undo stack, for later restoration. However, it doesn't copy the collection membership listbase, so the undo copy of an edit bone points to the same listbase memory as the edit bone still in the armature. If the latter gets deleted, the collection membership listbase also gets deleted, and the undo edit bone is then pointing at invalid memory. This issue is relatively straightforward to address, by simply doing proper copy of that membership listbase... except that will still interact badly with the remaining issues.editors/armature/editarmature_undo.cc
doesn't handle bone collections at all. This means that adding/removing collections while in armature edit mode doesn't get undone. That on its own needs to get fixed just because it's faulty undo behavior. But it also can result in invalid memory access, due to the collection membership listbase stored in the undo edit bones. If a collection is removed, and then you undo, one of the edit bones may still be pointing to the removed collection. But even after fixing things to restore removed collections on undo, they presumably will not have the same memory address, so the undo edit bones will still point to invalid memory.