From 3e82574d0f1e7992b0a345691407f8f42ad6ef9d Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Wed, 22 Mar 2023 12:34:04 +0100 Subject: [PATCH] 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. --- source/blender/blenkernel/intern/lib_id.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/blenkernel/intern/lib_id.c b/source/blender/blenkernel/intern/lib_id.c index 866e3af4894..757d2390f22 100644 --- a/source/blender/blenkernel/intern/lib_id.c +++ b/source/blender/blenkernel/intern/lib_id.c @@ -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)) { -- 2.30.2