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.
This commit is contained in:
parent
a0e82342d7
commit
8197b247d9
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue