[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [52002] trunk/blender/source/blender/ makesrna/intern/rna_access.c: patch [#32874] Fixed the property path calculation in situations where the link. index variable gets set during the search.

Campbell Barton ideasman42 at gmail.com
Thu Nov 8 10:38:20 CET 2012


Revision: 52002
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=52002
Author:   campbellbarton
Date:     2012-11-08 09:38:18 +0000 (Thu, 08 Nov 2012)
Log Message:
-----------
patch [#32874] Fixed the property path calculation in situations where the link.index variable gets set during the search.
>From Florian K?\246berle

Modified Paths:
--------------
    trunk/blender/source/blender/makesrna/intern/rna_access.c

Modified: trunk/blender/source/blender/makesrna/intern/rna_access.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_access.c	2012-11-08 08:16:44 UTC (rev 52001)
+++ trunk/blender/source/blender/makesrna/intern/rna_access.c	2012-11-08 09:38:18 UTC (rev 52002)
@@ -4011,12 +4011,15 @@
 	BLI_assert(haystack->type == IDP_GROUP);
 
 	link.up = parent_link;
+	/* always set both name and index,
+	 * else a stale value might get used */
 	link.name = NULL;
 	link.index = -1;
 
 	for (i = 0, iter = haystack->data.group.first; iter; iter = iter->next, i++) {
 		if (needle == iter) {  /* found! */
 			link.name = iter->name;
+			link.index = -1;
 			path = rna_idp_path_create(&link);
 			break;
 		}
@@ -4026,6 +4029,7 @@
 				PointerRNA child_ptr = RNA_pointer_get(ptr, iter->name);
 				if (child_ptr.type) {
 					link.name = iter->name;
+					link.index = -1;
 					if ((path = rna_idp_path(&child_ptr, iter, needle, &link))) {
 						break;
 					}




More information about the Bf-blender-cvs mailing list