[Bf-blender-cvs] [0c4fdaf0a07] uuid-undo-experiments: Merge branch 'uuid-id' into uuid-undo-experiments
Bastien Montagne
noreply at git.blender.org
Fri Feb 28 17:42:08 CET 2020
Commit: 0c4fdaf0a073b0f95698533a65cce559d6eca3bf
Author: Bastien Montagne
Date: Fri Feb 28 17:42:01 2020 +0100
Branches: uuid-undo-experiments
https://developer.blender.org/rB0c4fdaf0a073b0f95698533a65cce559d6eca3bf
Merge branch 'uuid-id' into uuid-undo-experiments
===================================================================
===================================================================
diff --cc source/blender/blenloader/intern/readfile.c
index 97072310e57,7da84475a51..5b83bc0cd03
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@@ -9146,19 -9012,11 +9148,21 @@@ static BHead *read_libblock(FileData *f
lb = which_libbase(main, idcode);
if (lb) {
/* for ID_LINK_PLACEHOLDER check */
- oldnewmap_insert(fd->libmap, bhead->old, id, bhead->code);
+ oldnewmap_insert(fd->libmap, id_bhead->old, id, id_bhead->code);
+
+ /* Some re-used old IDs might also use newly read ones, so we have to check for old memory
+ * addresses for those as well. */
+ if (fd->memfile != NULL && do_partial_undo && id->lib == NULL) {
+ BLI_assert(fd->old_idmap != NULL);
+ ID *id_old = BKE_main_idmap_lookup(fd->old_idmap, idcode, id->name + 2, NULL);
+ if (id_old != NULL) {
+ oldnewmap_insert(fd->libmap_undo_reused, id_old, id, id_bhead->code);
+ }
+ }
BLI_addtail(lb, id);
+
+ BKE_lib_libblock_uuid_generate(id);
}
else {
/* unknown ID type */
More information about the Bf-blender-cvs
mailing list