[Bf-blender-cvs] [50e80727084] blender-v2.83-release: Fix T83055: setting rna pointer properties can create bogus custom properties

Philipp Oeser noreply at git.blender.org
Wed Dec 2 08:50:18 CET 2020


Commit: 50e8072708428a169f7049a2626c2392b7c4e202
Author: Philipp Oeser
Date:   Thu Nov 26 16:21:55 2020 +0100
Branches: blender-v2.83-release
https://developer.blender.org/rB50e8072708428a169f7049a2626c2392b7c4e202

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

===================================================================

M	source/blender/makesrna/intern/rna_access.c

===================================================================

diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index b56a18c18a9..317d3ede855 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -3822,9 +3822,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) {



More information about the Bf-blender-cvs mailing list