Maniphest T96452

Armature corrupted after undo
Closed, Resolved

Assigned To
Bastien Montagne (mont29)
Authored By
Kirill (AngryBearr)
Mar 14 2022, 2:45 PM
Tags
  • Core
  • Animation & Rigging
  • BF Blender (3.1)
Subscribers
Bastien Montagne (mont29)
Kirill (AngryBearr)

Description

System Information
Operating system: Windows-10-10.0.19044-SP0 64 Bits
Graphics card: NVIDIA GeForce RTX 3070 Ti/PCIe/SSE2 NVIDIA Corporation 4.5.0 NVIDIA 511.79

Blender Version
Broken: version: 3.1.0, branch: master, commit date: 2022-03-08 18:16, hash: rBc77597cd0e15
Worked: 2.93

Short description of error
Joining armatures and undoing causes armature to be corrupted

Exact steps for others to reproduce the error

  1. Open file
  2. Join 2 armatures
  3. Undo

Check bone constraints or bone properties, they will be obviously corrupted(bad name, missing properties, can't enter edit mode). With no constraints present, bones can dissapear completely

Revisions and Commits

rB Blender

Related Objects

Mentioned In
T96241: 3.1: Potential candidates for corrective releases
T96495: Fix bad behavior of Armature Join operator
Mentioned Here
rBe648e388874a: Undo: Clear more ID runtime data on filewrite.

Event Timeline

Kirill (AngryBearr) created this task.Mar 14 2022, 2:45 PM
Richard Antalik (ISS) renamed this task from Bone constraint properties disappear to Armature corrupted after undo.Mar 15 2022, 1:30 AM
Richard Antalik (ISS) changed the task status from Needs Triage to Confirmed.
Richard Antalik (ISS) updated the task description.
Richard Antalik (ISS) added projects: Core, Animation & Rigging.
Bastien Montagne (mont29) edited projects, added BF Blender (3.1); removed BF Blender.Mar 15 2022, 2:59 PM
Bastien Montagne (mont29) added a subscriber: Bastien Montagne (mont29).

OK, issue is caused by rBe648e388874a: Undo: Clear more ID runtime data on filewrite., specifically the clearing of the ID user count on write introduced by this commit.

However, this is merely revealing a bug in the join operator for armatures, and a bad behavior:

  • Bug: Armature data ID of the source is left empty (all of its bones being moved to destination one), but the ID is not properly tagged as changed.
    • Before rBe648e388874a317, the change in ID.us (since object using the source armature is deleted) was enough for undo to detect ID as changed.
  • Bad behavior: Editing the source Armature ID is very bad - other unaffected objects might be using it. It is also different behavior from e.g. Mesh objects joining. Code should either:
    1. Leave the source armature ID unchanged, and work with a temp copy of it.
    2. Delete the source armature ID together with its object.

Think bad behavior should be fixed by option 1.


Will commit missing DEG tag, which fixes the crash and is safe enough to be backported to 3.1 should we do a corrective release. Will leave proper fix of the behavior of this operator itself to the Animation & Rigging team.

Bastien Montagne (mont29) closed this task as Resolved by committing rB2156841c8ca8: Fix T96452: Armature corrupted after undoing 'Join' operation..Mar 15 2022, 3:03 PM
Bastien Montagne (mont29) claimed this task.
Bastien Montagne (mont29) added a commit: rB2156841c8ca8: Fix T96452: Armature corrupted after undoing 'Join' operation..
Philipp Oeser (lichtwerk) added a commit: rB2fc52fb74239: Fix T96452: Armature corrupted after undoing 'Join' operation..Mar 21 2022, 2:07 PM