diff options
author | Bastien Montagne <bastien@blender.org> | 2021-10-21 16:04:39 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2021-10-21 16:22:35 +0300 |
commit | 7681326acdd66ecad9f85f57d1d14858b6223e51 (patch) | |
tree | aae8242911d8cf532b1bcab3a15f1bad046fb85b /source/blender/blenkernel/intern/lib_id.c | |
parent | 10fb5cc58d210592ef0ae410e305be906ad5ce51 (diff) |
IDManagement: Assign current Main's lib to newly created IDs.
This is mainly for doversion code, when it needs to create new IDs those
should be considered as part of the same library as the current Main's
one.
No practical changes are expected here, this is more of a general
consistency fix, and a pre-requisite for {T92333}.
Diffstat (limited to 'source/blender/blenkernel/intern/lib_id.c')
-rw-r--r-- | source/blender/blenkernel/intern/lib_id.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/lib_id.c b/source/blender/blenkernel/intern/lib_id.c index 9e86ef0e3b7..bc0a8e2b9b8 100644 --- a/source/blender/blenkernel/intern/lib_id.c +++ b/source/blender/blenkernel/intern/lib_id.c @@ -1141,6 +1141,11 @@ void *BKE_libblock_alloc(Main *bmain, short type, const char *name, const int fl /* alphabetic insertion: is in new_id */ BKE_main_unlock(bmain); + /* This is important in 'readfile doversion after liblink' context mainly, but is a good + * consistency change in general: ID created for a Main should get that main's current + * library pointer. */ + id->lib = bmain->curlib; + /* TODO: to be removed from here! */ if ((flag & LIB_ID_CREATE_NO_DEG_TAG) == 0) { DEG_id_type_tag(bmain, type); |