[Bf-blender-cvs] [b32151a2bbe] uuid-undo-experiments-swap-reread-datablocks: Merge branch 'uuid-undo-experiments' into uuid-undo-experiments-swap-reread-datablocks

Bastien Montagne noreply at git.blender.org
Mon Mar 2 18:03:42 CET 2020


Commit: b32151a2bbe7d405d8b2030187ba5bff6b7832ba
Author: Bastien Montagne
Date:   Mon Mar 2 18:00:20 2020 +0100
Branches: uuid-undo-experiments-swap-reread-datablocks
https://developer.blender.org/rBb32151a2bbe7d405d8b2030187ba5bff6b7832ba

Merge branch 'uuid-undo-experiments' into uuid-undo-experiments-swap-reread-datablocks

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



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

diff --cc source/blender/blenloader/intern/readfile.c
index a80da2a8db9,ecf169ab219..1f939d0dfb4
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@@ -9183,22 -9161,14 +9183,28 @@@ static BHead *read_libblock(FileData *f
          }
        }
  
 +      /* At this point, we know we are going to keep that newly read & allocated ID, so we need to
 +       * reallocate it to ensure we actually get a unique memory address for it. */
 +      if (!do_id_swap) {
 +        DEBUG_PRINTF("using newly-read ID %s to a new mem address\n", id->name);
 +      }
 +      else {
 +        DEBUG_PRINTF("using newly-read ID %s to its old, already existing address\n", id->name);
 +      }
 +
 +      /* for ID_LINK_PLACEHOLDER check */
 +      ID *id_target = do_id_swap ? id_old : id;
 +      oldnewmap_insert(fd->libmap, id_bhead->old, id_target, id_bhead->code);
 +      oldnewmap_insert(fd->libmap, id_old, id_target, id_bhead->code);
 +
        BLI_addtail(lb, id);
  
+       if (fd->memfile == NULL) {
+         /* When actually reading a file , we do want to reset/re-generate session uuids.
+          * In unod case, we want to re-use existing ones. */
+         id->session_uuid = MAIN_ID_SESSION_UUID_UNSET;
+       }
+ 
        BKE_lib_libblock_uuid_generate(id);
      }
      else {



More information about the Bf-blender-cvs mailing list