From 1f63b0807b9f604d593f945fb02cb443250ea84f Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Wed, 19 Mar 2014 12:43:29 +0100 Subject: [PATCH] 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__)... --- source/blender/makesrna/intern/rna_access.c | 8 ++++++-- 1 file 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;