[Bf-blender-cvs] [fdafa4f5bd7] undo-experiments: Undoexp: do not tag re-used IDs with LIB_TAG_NEW.

Bastien Montagne noreply at git.blender.org
Thu Jan 2 10:59:14 CET 2020


Commit: fdafa4f5bd7ba5dee54a6556a9b4766795c4b002
Author: Bastien Montagne
Date:   Thu Jan 2 10:48:42 2020 +0100
Branches: undo-experiments
https://developer.blender.org/rBfdafa4f5bd7ba5dee54a6556a9b4766795c4b002

Undoexp: do not tag re-used IDs with LIB_TAG_NEW.

===================================================================

M	source/blender/blenloader/intern/readfile.c

===================================================================

diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 467edb6cc33..e4b2fce86fc 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -9458,7 +9458,10 @@ static BHead *read_libblock(FileData *fd,
           MEM_freeN(id);
           id = (ID *)id_bhead->old;
 
-          id->tag = tag | LIB_TAG_NEED_LINK | LIB_TAG_NEW;
+          /* Do not add LIB_TAG_NEW here, this should not be needed/used in undo case anyway (as
+           * this is only for do_version-like code), but for sake of consistency, and also because
+           * it will tell us which ID is re-used from old Main, and which one is actually new. */
+          id->tag = tag | LIB_TAG_NEED_LINK;
           id->lib = main->curlib;
           id->us = ID_FAKE_USERS(id);
           /* Do not reset id->icon_id here, memory allocated for it remains valid. */



More information about the Bf-blender-cvs mailing list