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:
authorCampbell Barton <ideasman42@gmail.com>2021-09-03 14:58:52 +0300
committerCampbell Barton <ideasman42@gmail.com>2021-09-03 14:58:52 +0300
commitf9ccd26b037d43f2490d1f0263e45e775d30473d (patch)
treedc0000ca166359e0820174f0a5b59cf3ce86c758 /source/blender/makesrna/intern/rna_access.c
parent0950cfd9d53ef666cf820765e83586f72b04e9b6 (diff)
Fix T87768: `.path_resolve` fails when requested property is None.
Add a version of RNA_path_resolve_full that returns true when the path resolves to a NULL RNA pointer.
Diffstat (limited to 'source/blender/makesrna/intern/rna_access.c')
-rw-r--r--source/blender/makesrna/intern/rna_access.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 75df8f929e8..0ba5b786187 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -5362,6 +5362,18 @@ bool RNA_path_resolve_full(
}
/**
+ * A version of #RNA_path_resolve_full doesn't check the value of #PointerRNA.data.
+ *
+ * \note While it's correct to ignore the value of #PointerRNA.data
+ * most callers need to know if the resulting pointer was found and not null.
+ */
+bool RNA_path_resolve_full_maybe_null(
+ PointerRNA *ptr, const char *path, PointerRNA *r_ptr, PropertyRNA **r_prop, int *r_index)
+{
+ return rna_path_parse(ptr, path, r_ptr, r_prop, r_index, NULL, NULL, true);
+}
+
+/**
* Resolve the given RNA Path to find both the pointer AND property
* indicated by fully resolving the path.
*