diff options
author | Bastien Montagne <b.mont29@gmail.com> | 2020-02-19 14:50:04 +0300 |
---|---|---|
committer | Bastien Montagne <b.mont29@gmail.com> | 2020-02-19 14:56:02 +0300 |
commit | 367ecff15d74ed99a305cbfcd46599e59a75db02 (patch) | |
tree | 934a582bc6adff2bf4843c3ad6487cf320ebe925 /source/blender/blenkernel/intern/blendfile.c | |
parent | bde215a60c16ce77a60ecb38eaf7802965d73c7f (diff) |
readfile: Move ID refcounting to libquery.
Having that extra ID users handling at readfile level, besides generic
one ensured by libquery, has been something bothering me for a long time
(had to fix my share of bugs due to mismatches between those two areas).
Further more, work on undo speedup will require even more complex ID
refcount management if we want to keep it in readfile.c area.
So idea is instead to generalize what we did for linked data already
when undoing: recompute properly usercount numbers after liblink step,
for all IDs.
Note that extra time required here is neglectable in a whole .blend file
reading (few extra milliseconds when loading a full production scene
e.g.).
Notes:
* Some deprecated data (IPOs) are not refcounted at all anymore, this
should not be an issue in pratice since the are supposed to get deleted
after doversion anyway.
* Refcounting happens after `do_versions_after_linking`, i.e those
functions won't get valid ID usercounts currently. Again, this is not a
problem in current code, if needed we could recompute refcount before,
and then ensure `do_versions_after_linoiing()` actually handles properly
usercount, which it does not currently.
Differential Revision: https://developer.blender.org/D6881
Diffstat (limited to 'source/blender/blenkernel/intern/blendfile.c')
-rw-r--r-- | source/blender/blenkernel/intern/blendfile.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/blendfile.c b/source/blender/blenkernel/intern/blendfile.c index d1188bdb220..efab2039dc3 100644 --- a/source/blender/blenkernel/intern/blendfile.c +++ b/source/blender/blenkernel/intern/blendfile.c @@ -372,7 +372,7 @@ static void setup_app_data(bContext *C, * lib_link on local IDs using linked ones. * There is no real way to predict amount of changes here, so we have to fully redo * refcounting . */ - BKE_main_id_refcount_recompute(bmain, true); + BKE_main_id_refcount_recompute(bmain, false); } } |