diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-28 12:04:07 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-28 12:06:31 +0300 |
commit | 3f74a5c5fd5239204eb1f5fcdb69af7ff37a9459 (patch) | |
tree | 8dd9af0215ed5b22090cf17988d1b8a39c6d33fd /source/blender/makesrna/intern/rna_access.c | |
parent | 33306cabbee4d618f0fea8756340f000f700746b (diff) |
Proper fix for RNA path evaluation of collection items.
Following RNA pointer way - only return evaluated item if asked for.
Diffstat (limited to 'source/blender/makesrna/intern/rna_access.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_access.c | 5 |
1 files changed, 2 insertions, 3 deletions
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; |