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__)...
This commit is contained in:
Bastien Montagne 2014-03-19 12:43:29 +01:00
parent 3f89b92823
commit 1f63b0807b
1 changed files with 6 additions and 2 deletions

View File

@ -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;