Undo: Writefile: fix 'id changed' detected when resorting IDs.

The ListBase next/prev pointers will change everytime you add or rename
an ID, also for 'neighbors' data-blocks in the list, causing unnecessary
'changed' detection.

This info is not needed in blendfile anyway, so just NULLify it.
This commit is contained in:
Bastien Montagne 2020-05-29 14:30:02 +02:00
parent 582d3153a1
commit d1bc233ffe
1 changed files with 5 additions and 0 deletions

View File

@ -4141,6 +4141,11 @@ static bool write_file_handle(Main *mainvar,
memcpy(id_buffer, id, idtype_struct_size);
((ID *)id_buffer)->tag = 0;
/* Those listbase data change everytime we add/remove an ID, and also often when renaming
* one (due to re-sorting). This avoids generating a lot of false 'is changed' detections
* between undo steps. */
((ID *)id_buffer)->prev = NULL;
((ID *)id_buffer)->next = NULL;
switch ((ID_Type)GS(id->name)) {
case ID_WM: