Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2020-07-13 13:47:49 +0300
committerBastien Montagne <bastien@blender.org>2020-07-13 13:51:29 +0300
commitf8afbb76571fa816a1d869240bdca595b97da846 (patch)
tree42357df372d3c3adb5ff3235096b66459b724218 /source/blender/makesrna/intern/rna_access.c
parent0158571b34693dae0f05b36a96e46d4685a1a03f (diff)
RNA property management: tweak to 'is set' information.
Only consider a full IDProperty as set if it actually exists in given PointerRNA data.
Diffstat (limited to 'source/blender/makesrna/intern/rna_access.c')
-rw-r--r--source/blender/makesrna/intern/rna_access.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 8bf715f93c1..793552c5c34 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -560,7 +560,10 @@ static PropertyRNA *arraytypemap[IDP_NUMTYPES] = {
/* This function initializes a PropertyRNAOrID with all required info, from a given PropertyRNA
* and PointerRNA data. It deals properly with the three cases (static RNA, runtime RNA, and
- * IDProperty). */
+ * IDProperty).
+ * WARNING: given `ptr` PointerRNA is assumed to be a valid data one here, calling code is
+ * responsible to ensure that.
+ */
void rna_property_rna_or_id_get(PropertyRNA *prop,
PointerRNA *ptr,
PropertyRNAOrID *r_prop_rna_or_id)
@@ -617,8 +620,8 @@ void rna_property_rna_or_id_get(PropertyRNA *prop,
r_prop_rna_or_id->idprop = idprop_evaluated;
r_prop_rna_or_id->is_idprop = true;
- /* Full IDProperties are always set. */
- r_prop_rna_or_id->is_set = true;
+ /* Full IDProperties are always set, if it exists. */
+ r_prop_rna_or_id->is_set = (idprop_evaluated != NULL);
r_prop_rna_or_id->identifier = idprop->name;
if (idprop->type == IDP_ARRAY) {