Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2020-05-29 15:30:02 +0300
committerBastien Montagne <bastien@blender.org>2020-05-29 15:30:02 +0300
commitd1bc233ffeff55568957f15ee129c3cbcb62bdf1 (patch)
tree8e657cd1dd67c0f42fc6c1413cdb5b49deaab9fb
parent582d3153a1e4cc8dd8c5d398d533fadf3a9e1702 (diff)
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.
-rw-r--r--source/blender/blenloader/intern/writefile.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 33467317090..2ffc8505397 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -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: