[Bf-blender-cvs] [1f63b08] master: Fix `bpy.types.Operator.bl_rna.foobar` not working since rBfe094eaf20.
Bastien Montagne
noreply at git.blender.org
Wed Mar 19 12:57:35 CET 2014
Commit: 1f63b0807b9f604d593f945fb02cb443250ea84f
Author: Bastien Montagne
Date: Wed Mar 19 12:43:29 2014 +0100
https://developer.blender.org/rB1f63b0807b9f604d593f945fb02cb443250ea84f
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__)...
===================================================================
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 10ad05c..43de4b3 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;
More information about the Bf-blender-cvs
mailing list