From 841ae186056b11994d6d857b644f656bb5274ebc Mon Sep 17 00:00:00 2001 From: Philipp Oeser Date: Thu, 26 Nov 2020 16:21:55 +0100 Subject: [PATCH] Fix T83055: setting rna pointer properties can create bogus custom properties This was reported in the form of the eyedropper of the 'Parent' property creating a custom property 'parent' if self was picked. Problem arises when certain checks for setting rna pointer properties failed (for example: the PROP_ID_SELF_CHECK check) and then a different code path was entered (which was only meant for IDProperties). Problem was introduced in rBa7b3047cefcb. To solve, now first enter the branch for rna-based pointer properties, then perform the sanity-checks (and if these fail: dont enter the other unrelated codepath but instead do nothing) Maniphest Tasks: T83055 Differential Revision: https://developer.blender.org/D9652 --- source/blender/makesrna/intern/rna_access.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 70fafaf8111..ceccccc3291 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -3723,9 +3723,11 @@ void RNA_property_pointer_set(PointerRNA *ptr, } } /* RNA property. */ - else if (pprop->set && !((prop->flag & PROP_NEVER_NULL) && ptr_value.data == NULL) && - !((prop->flag & PROP_ID_SELF_CHECK) && ptr->owner_id == ptr_value.owner_id)) { - pprop->set(ptr, ptr_value, reports); + else if (pprop->set) { + if (!((prop->flag & PROP_NEVER_NULL) && ptr_value.data == NULL) && + !((prop->flag & PROP_ID_SELF_CHECK) && ptr->owner_id == ptr_value.owner_id)) { + pprop->set(ptr, ptr_value, reports); + } } /* IDProperty desguised as RNA property (and not yet defined in ptr). */ else if (prop->flag & PROP_EDITABLE) {