diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-01-29 06:28:55 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-01-29 06:28:55 +0300 |
commit | 59a0a143ddb50e2835125a69f20e597f5dab4d91 (patch) | |
tree | 14f687339f89bb9336b426da9652d25a78831dca /source/blender/blenkernel | |
parent | 957b4547aeebc8c5a438ea507e8033cb563b7f40 (diff) |
Library: tag memfile undo for writing after rename
Needed for T60809 fix.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/library.c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 957004c496f..7392dc23119 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -1646,8 +1646,11 @@ void id_clear_lib_data_ex(Main *bmain, ID *id, const bool id_in_mainlist) id->lib = NULL; id->tag &= ~(LIB_TAG_INDIRECT | LIB_TAG_EXTERN); - if (id_in_mainlist) - new_id(which_libbase(bmain, GS(id->name)), id, NULL); + if (id_in_mainlist) { + if (new_id(which_libbase(bmain, GS(id->name)), id, NULL)) { + bmain->is_memfile_undo_written = false; + } + } /* Internal bNodeTree blocks inside datablocks also stores id->lib, make sure this stays in sync. */ if ((ntree = ntreeFromID(id))) { @@ -2015,9 +2018,11 @@ void BLI_libblock_ensure_unique_name(Main *bmain, const char *name) /* search for id */ idtest = BLI_findstring(lb, name + 2, offsetof(ID, name) + 2); - - if (idtest && !new_id(lb, idtest, idtest->name + 2)) { - id_sort_by_name(lb, idtest); + if (idtest != NULL) { + if (!new_id(lb, idtest, idtest->name + 2)) { + id_sort_by_name(lb, idtest); + } + bmain->is_memfile_undo_written = false; } } @@ -2027,7 +2032,9 @@ void BLI_libblock_ensure_unique_name(Main *bmain, const char *name) void BKE_libblock_rename(Main *bmain, ID *id, const char *name) { ListBase *lb = which_libbase(bmain, GS(id->name)); - new_id(lb, id, name); + if (new_id(lb, id, name)) { + bmain->is_memfile_undo_written = false; + } } /** |