Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <montagne29@wanadoo.fr>2018-11-02 16:31:13 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2018-11-02 17:12:10 +0300
commit8197b247d9d4df29ae55bc03a0687fce744eed05 (patch)
tree320d432932f412e2c72b55ebaef474008de06cdf /source/blender/blenkernel/intern/library.c
parenta0e82342d7cebb44e703c5989e5eb411a22653de (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.
Diffstat (limited to 'source/blender/blenkernel/intern/library.c')
-rw-r--r--source/blender/blenkernel/intern/library.c6
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);