diff options
author | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2020-01-18 19:25:59 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@gmail.com> | 2020-01-20 11:39:54 +0300 |
commit | 6368343da9a0aed8511de37b91161ea47418909d (patch) | |
tree | 3ee51bc974b002e380e2caf1c6fea91f12ce12b9 /source/blender/blenkernel | |
parent | 6395937b01f0f6ca8669d694edcf9e7d258a30a1 (diff) |
Fix T73129: sculpt mode slow on mesh with fake user
We can't use the fast path when the mesh is used by mulitple objects and so
slower sculpting is expected then. But fake users should not affect this. This
also fixes the same type of error in a few other areas.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_library.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/library.c | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_library.h b/source/blender/blenkernel/BKE_library.h index c41cd50eba5..21dd5aaaf8f 100644 --- a/source/blender/blenkernel/BKE_library.h +++ b/source/blender/blenkernel/BKE_library.h @@ -184,6 +184,7 @@ void id_us_plus(struct ID *id); void id_us_min(struct ID *id); void id_fake_user_set(struct ID *id); void id_fake_user_clear(struct ID *id); +int BKE_id_num_real_users(const struct ID *id); void BKE_id_clear_newpoin(struct ID *id); void BKE_id_make_local_generic(struct Main *bmain, diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index e051dc946cb..dabf44be42e 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -294,6 +294,11 @@ void id_fake_user_clear(ID *id) } } +int BKE_id_num_real_users(const ID *id) +{ + return (id->flag & LIB_FAKEUSER) ? id->us - 1 : id->us; +} + void BKE_id_clear_newpoin(ID *id) { if (id->newid) { |