[Bf-blender-cvs] [3f74a5c5fd5] blender2.8: Proper fix for RNA path evaluation of collection items.
Bastien Montagne
noreply at git.blender.org
Thu Jun 28 11:06:50 CEST 2018
Commit: 3f74a5c5fd5239204eb1f5fcdb69af7ff37a9459
Author: Bastien Montagne
Date: Thu Jun 28 11:04:07 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB3f74a5c5fd5239204eb1f5fcdb69af7ff37a9459
Proper fix for RNA path evaluation of collection items.
Following RNA pointer way - only return evaluated item if asked for.
===================================================================
M 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;
More information about the Bf-blender-cvs
mailing list