Make new library IDs named from the .blend file.

Now that we do use that ID name of them in UI sometimes...
This commit is contained in:
Bastien Montagne
2018-10-31 12:41:38 +01:00
parent 08a92d8578
commit 06c5a9426a

View File

@@ -674,7 +674,7 @@ static Main *blo_find_main(FileData *fd, const char *filepath, const char *relab
/* Add library datablock itself to 'main' Main, since libraries are **never** linked data.
* Fixes bug where you could end with all ID_LI datablocks having the same name... */
lib = BKE_libblock_alloc(mainlist->first, ID_LI, "Lib", 0);
lib = BKE_libblock_alloc(mainlist->first, ID_LI, BLI_path_basename(filepath), 0);
lib->id.us = ID_FAKE_USERS(lib); /* Important, consistency with main ID reading code from read_libblock(). */
BLI_strncpy(lib->name, filepath, sizeof(lib->name));
BLI_strncpy(lib->filepath, name1, sizeof(lib->filepath));