From 3f74a5c5fd5239204eb1f5fcdb69af7ff37a9459 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 28 Jun 2018 11:04:07 +0200 Subject: Proper fix for RNA path evaluation of collection items. Following RNA pointer way - only return evaluated item if asked for. --- source/blender/makesrna/intern/rna_access.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to '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 00f9c51fe10..5e8e33e660f 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -4680,7 +4680,7 @@ static bool rna_path_parse(PointerRNA *ptr, const char *path, /* resolve pointer if further path elements follow * or explicitly requested */ - if (eval_pointer || *path) { + if (eval_pointer || *path != '\0') { PointerRNA nextptr = RNA_property_pointer_get(&curptr, prop); curptr = nextptr; @@ -4701,8 +4701,7 @@ static bool rna_path_parse(PointerRNA *ptr, const char *path, return false; } - /* Only reset current pointer & prop if we still have something to parse, else we lose the result! */ - if (path[0] != '\0') { + if (eval_pointer || *path != '\0') { curptr = nextptr; prop = NULL; /* now we have a PointerRNA, the prop is our parent so forget it */ index = -1; -- cgit v1.2.3