[Bf-blender-cvs] [c67d0cb5ce2] undo-experiments: Merge branch 'id-ensure-unique-memory-address' into undo-experiments

Bastien Montagne noreply at git.blender.org
Tue Feb 11 17:54:19 CET 2020


Commit: c67d0cb5ce24b887d6f63931ad14c37ff08fada2
Author: Bastien Montagne
Date:   Tue Feb 11 17:54:13 2020 +0100
Branches: undo-experiments
https://developer.blender.org/rBc67d0cb5ce24b887d6f63931ad14c37ff08fada2

Merge branch 'id-ensure-unique-memory-address' into undo-experiments

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



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

diff --cc source/blender/blenkernel/BKE_main.h
index fd7aa931214,03edc93ac16..d22d2fcf507
--- a/source/blender/blenkernel/BKE_main.h
+++ b/source/blender/blenkernel/BKE_main.h
@@@ -99,12 -99,10 +99,15 @@@ typedef struct Main 
     * use "needs_flush_to_id" in edit data to flag data which needs updating.
     */
    char is_memfile_undo_flush_needed;
 +  /**
 +   * Indicates that next memfile undo step should not allow to re-use old bmain when re-read, but
 +   * instead do a complete full re-read/update from stored memfile.
 +   */
 +  char use_memfile_full_barrier;
  
+   struct GSet *used_id_memset;
+   short used_id_memset_tag;
+ 
    BlendThumbnail *blen_thumb;
  
    struct Library *curlib;
diff --cc source/blender/blenloader/intern/readfile.c
index da4200b3c57,280ef5d585e..5afd0dbb18d
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@@ -9198,8 -9057,12 +9203,12 @@@ static BHead *read_libblock(FileData *f
    id->newid = NULL; /* Needed because .blend may have been saved with crap value here... */
    id->orig_id = NULL;
  
+   const bool is_id_memaddress_unique = BKE_main_idmemset_register_id(main, id);
+   /* Note: this is likely to fail at some point with current undo/redo code! */
+   BLI_assert(is_id_memaddress_unique);
+ 
    /* this case cannot be direct_linked: it's just the ID part */
 -  if (bhead->code == ID_LINK_PLACEHOLDER) {
 +  if (id_bhead->code == ID_LINK_PLACEHOLDER) {
      /* That way, we know which data-lock needs do_versions (required currently for linking). */
      id->tag = tag | LIB_TAG_ID_LINK_PLACEHOLDER | LIB_TAG_NEED_LINK | LIB_TAG_NEW;



More information about the Bf-blender-cvs mailing list