diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-11-02 16:31:13 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-11-02 17:12:10 +0300 |
commit | 8197b247d9d4df29ae55bc03a0687fce744eed05 (patch) | |
tree | 320d432932f412e2c72b55ebaef474008de06cdf | |
parent | a0e82342d7cebb44e703c5989e5eb411a22653de (diff) |
Fix 'id_single_user' wrongly reseting usercount to 0.
We want to undo the initial usercount from low-level ID duplication, not
to erase all possible extra processing (like e.g. setting Fake User...).
Fixes part of mess in brush usercount.
-rw-r--r-- | source/blender/blenkernel/intern/library.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 21424f4be53..ff663cfab01 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -776,9 +776,9 @@ bool id_single_user(bContext *C, ID *id, PointerRNA *ptr, PropertyRNA *prop) if (id_copy(bmain, id, &newid, false) && newid) { /* copy animation actions too */ BKE_animdata_copy_id_action(bmain, id, false); - /* us is 1 by convention, but RNA_property_pointer_set - * will also increment it, so set it to zero */ - newid->us = ID_FAKE_USERS(newid); + /* us is 1 by convention with new IDs, but RNA_property_pointer_set + * will also increment it, decrement it here. */ + id_us_min(newid); /* assign copy */ RNA_id_pointer_create(newid, &idptr); |