Fix #105989: Outliner: Make Single User duplicates data

This happens even though there is only one user.

The Outliner only implements this `Make Single User` for worlds
(`singleuser_world_fn`) and actions (`singleuser_action_fn`) [it is
questionable if the whole functionality could be removed really, but
this is for another report] and it uses `id_single_user` to do so --
this function does not check if we even have more than one user though,
so data gets duplicated resulting in duplicate worlds or actions even if
they only have one user and shouldnt be touched.

Now let `id_single_user` check usercount and only act if we have more
than one real users.

Pull Request: https://projects.blender.org/blender/blender/pulls/105991
This commit is contained in:
Philipp Oeser 2023-04-04 09:12:37 +02:00 committed by Philipp Oeser
parent 14b112ef82
commit e952083652

@ -821,7 +821,7 @@ bool id_single_user(bContext *C, ID *id, PointerRNA *ptr, PropertyRNA *prop)
ID *newid = NULL;
PointerRNA idptr;
if (id) {
if (id && (ID_REAL_USERS(id) > 1)) {
/* If property isn't editable,
* we're going to have an extra block hanging around until we save. */
if (RNA_property_editable(ptr, prop)) {