[Bf-blender-cvs] [3360db83c45] blender-v2.83-release: Fix T76883: Zero users scenes after undo.

Bastien Montagne noreply at git.blender.org
Wed May 20 10:42:46 CEST 2020


Commit: 3360db83c45ea225162080b43632549dd4f902f0
Author: Bastien Montagne
Date:   Wed May 20 10:39:50 2020 +0200
Branches: blender-v2.83-release
https://developer.blender.org/rB3360db83c45ea225162080b43632549dd4f902f0

Fix T76883: Zero users scenes after undo.

Some tags need to be preserved when we reuse existing ID entirely.
AFAICT, currently this is only the EXTRAUSER one.

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

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

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

diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 45ebc10e8a2..22862fc1d0d 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -9539,7 +9539,8 @@ static void read_libblock_undo_restore_identical(
   BLI_assert((fd->skip_flags & BLO_READ_SKIP_UNDO_OLD_MAIN) == 0);
   BLI_assert(id_old != NULL);
 
-  id_old->tag = tag;
+  /* Some tags need to be preserved here. */
+  id_old->tag = tag | (id_old->tag & LIB_TAG_EXTRAUSER);
   id_old->lib = main->curlib;
   id_old->us = ID_FAKE_USERS(id_old);
   /* Do not reset id->icon_id here, memory allocated for it remains valid. */



More information about the Bf-blender-cvs mailing list