From e95208365286cd1dc26899445daf15f64d7adf38 Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Tue, 4 Apr 2023 09:12:37 +0200 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. Pull Request: https://projects.blender.org/blender/blender/pulls/105991 --- 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)) {