Fix (unreported) Append/link code: All library datablocks could end with same name.
This was broken since ages I think, did not really hurt since we usually never use libs' names to access them. Rather bad behavior however, breaking a ground rule of our ID system! And no real reason to add new libraries to new (split) Main at all, libraries are never considered linked datablocks, which means they should always be in 'main' Main->library list. Not a regression, but should be included in 2.76 imho.
This commit is contained in:
parent
8da3c5c1b9
commit
df80aeb162
|
@ -618,7 +618,9 @@ static Main *blo_find_main(FileData *fd, const char *filepath, const char *relab
|
|||
m = BKE_main_new();
|
||||
BLI_addtail(mainlist, m);
|
||||
|
||||
lib = BKE_libblock_alloc(m, ID_LI, "lib");
|
||||
/* 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");
|
||||
BLI_strncpy(lib->name, filepath, sizeof(lib->name));
|
||||
BLI_strncpy(lib->filepath, name1, sizeof(lib->filepath));
|
||||
|
||||
|
|
Loading…
Reference in New Issue