diff options
author | Bastien Montagne <bastien@blender.org> | 2021-05-26 12:45:27 +0300 |
---|---|---|
committer | Bastien Montagne <bastien@blender.org> | 2021-05-26 18:05:00 +0300 |
commit | ee849ca0f8f60c142dce7ecea1be74d382247c12 (patch) | |
tree | 2a97e1dddb70d668401fb740a97df1eab9c4746b /source/blender/blenkernel/intern/lib_id.c | |
parent | 8f9599d17e80254928d2d72081a4c7e0dee64038 (diff) |
ID management: Do not assume that `NO_MAIN` means `NO_USER_REFCOUNT`
While this is still very fuzzy in current code, this old behavior makes
it close to impossible to efficiently use out-of-main temp data, as it
implies that we'd need to update refcounts everytime we add something
back into BMain (an 'un-refcount' ID usages when removing from BMain).
Now that we have two separate flags/tags for those two different things,
let's not merge them anymore.
Note that this is somewhat on-going process, still needs more checks and
cleanup. Related to T88555.
Diffstat (limited to 'source/blender/blenkernel/intern/lib_id.c')
-rw-r--r-- | source/blender/blenkernel/intern/lib_id.c | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/source/blender/blenkernel/intern/lib_id.c b/source/blender/blenkernel/intern/lib_id.c index c2e5006cbc1..8ad524dea21 100644 --- a/source/blender/blenkernel/intern/lib_id.c +++ b/source/blender/blenkernel/intern/lib_id.c @@ -1221,14 +1221,6 @@ void BKE_libblock_copy_ex(Main *bmain, const ID *id, ID **r_newid, const int ori BLI_assert((flag & LIB_ID_CREATE_NO_MAIN) != 0 || bmain != NULL); BLI_assert((flag & LIB_ID_CREATE_NO_MAIN) != 0 || (flag & LIB_ID_CREATE_NO_ALLOCATE) == 0); BLI_assert((flag & LIB_ID_CREATE_NO_MAIN) != 0 || (flag & LIB_ID_CREATE_LOCAL) == 0); - if (!is_private_id_data) { - /* When we are handling private ID data, we might still want to manage usercounts, even - * though that ID data-block is actually outside of Main... */ - BLI_assert((flag & LIB_ID_CREATE_NO_MAIN) == 0 || - (flag & LIB_ID_CREATE_NO_USER_REFCOUNT) != 0); - } - /* Never implicitly copy shapekeys when generating temp data outside of Main database. */ - BLI_assert((flag & LIB_ID_CREATE_NO_MAIN) == 0 || (flag & LIB_ID_COPY_SHAPEKEY) == 0); /* 'Private ID' data handling. */ if ((bmain != NULL) && is_private_id_data) { |