Blender Git Loki

Git Commits -> Revision 91f07fb

June 25, 2020, 08:42 (GMT)
Fix T77774: New undo code broken by 'make local' behavior.

This is actually a nice issue due to too much optimization...
* Making an ID local just reuse the linked one whenever possible, instead of
actually making a copy of it.
* Therefore, the collection containing that ID is seen as unchanged, since
the pointer itself remained the same.
* But on undo step, there is no way to reuse that local object, which then
gets deleted, and linked one gets re-created - at a different address.
* Collection, however, since unchanged, is not updated at all and thus keeps
reference to the to-be-deleted local object, instead of the linked one.
* Issue gets even worse with viewlayers, this leads to the crash.

To address this, this patch adds a 'virtual' update flags that does nothing
in update case, but will ensure that the affected IDs using the one made local
are properly detected as changed across the relevant undo step.

Note that the recalc flags were chosen mostly for a logical reason, and also
because they are already properly dealt with and cleared by undo code,
so this looks like the optimal solution.

Note: slightly ammended for 2.83, change should not have any effect in
practice.

Reviewed By: brecht

Maniphest Tasks: T77774

Differential Revision: https://developer.blender.org/D8006

Commit Details:

Full Hash: 91f07fbfd662ddb311d4dc459eab556db5936370
Parent Commit: 6e13cff
Lines Changed: +38, -2

2 Modified Paths:

/source/blender/blenkernel/intern/lib_id.c (+29, -2) (Diff)
/source/blender/makesdna/DNA_ID.h (+9, -0) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021