Fix (unreported) bad LI_ID usercount when linking a new lib.
Library datablocks shall have a zero user count in Blender currently...
This commit is contained in:
@@ -622,6 +622,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");
|
||||
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));
|
||||
|
||||
|
||||
Reference in New Issue
Block a user