diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2014-03-19 15:43:29 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2014-03-19 15:50:17 +0400 |
commit | 1f63b0807b9f604d593f945fb02cb443250ea84f (patch) | |
tree | 1f2a07a0c8dc6acbff4319a547cfdc87dbae6112 /source/blender/makesrna/intern/rna_access.c | |
parent | 3f89b92823627ee9944b75403b8c89e94845c470 (diff) |
Fix `bpy.types.Operator.bl_rna.foobar` not working since rBfe094eaf20.
When path to resolve "finishes" on a collection prop, do not erase the returned prop!
This caused py's path_resolve to return same PointerRNA as the one passed as parameter, leading to
inifinte recursion in Operator's accessor func (__getattribute__)...
Diffstat (limited to 'source/blender/makesrna/intern/rna_access.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_access.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index 10ad05c37c5..43de4b374b4 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -4088,8 +4088,12 @@ static bool rna_path_parse(PointerRNA *ptr, const char *path, break; } case PROP_COLLECTION: { - /* resolve pointer if further path elements follow or explicitly requested */ - if (eval_pointer || *path) { + /* Resolve pointer if further path elements follow. + * Note that if path is empty, rna_path_parse_collection_key will do nothing anyway, + * so eval_pointer is of no use here (esp. as in this case, we want to keep found prop, + * erasing it breaks operators - e.g. bpy.types.Operator.bl_rna.foobar errors...). + */ + if (*path) { PointerRNA nextptr; if (!rna_path_parse_collection_key(&path, &curptr, prop, &nextptr)) return false; |