Files
test/source
Nathan Vegdahl d64e4a387a Fix #111780: bone collections and undo don't work together
The issue was that Armatures have their own edit-mode undo system, but it
didn't account for bone collections yet.

The solution implemented here is to also copy the list of BoneCollections
in each edit-mode undo step, just like EditBones themselves already are.
Additionally, the undo EditBones now have their bone collection membership
remapped to point at those undo copies, so that the entire undo step is
self-contained.

When restoring from an undo step, we simply do the reverse: copy all of
the EditBones and BoneCollections back to the actual armature, and remap
the EditBone collection membership appropriately.

This patch also includes a temporary workaround for a final issue, where
BoneCollection membership information could be lost when undoing pops you
out of edit mode.  The correct solution for this is a bit involved, and
will be part of a future PR.  But the workaround ensures that things
aren't broken in the mean time.

Pull Request: https://projects.blender.org/blender/blender/pulls/111965
2023-09-11 18:28:15 +02:00
..