diff options
author | Philipp Oeser <info@graphics-engineer.com> | 2020-11-26 18:21:55 +0300 |
---|---|---|
committer | Philipp Oeser <info@graphics-engineer.com> | 2020-11-26 19:18:48 +0300 |
commit | 841ae186056b11994d6d857b644f656bb5274ebc (patch) | |
tree | c87ea7a9faaa1940aa34c5dd2c91e662dfa7aa7c /source/blender/makesrna/intern/rna_access.c | |
parent | 4b248c16589b1cdf12b82f74a4ac32e29b6b10f4 (diff) |
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
Diffstat (limited to 'source/blender/makesrna/intern/rna_access.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_access.c | 8 |
1 files 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) { |