[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [33411] trunk/blender/source/blender/ makesrna/intern/rna_access.c: partial fix [#23265] matrix_world rna path is visible but returns 0 to drivers without error however accessed

Campbell Barton ideasman42 at gmail.com
Wed Dec 1 11:17:32 CET 2010


Revision: 33411
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33411
Author:   campbellbarton
Date:     2010-12-01 11:17:31 +0100 (Wed, 01 Dec 2010)

Log Message:
-----------
partial fix [#23265] matrix_world rna path is visible but returns 0 to drivers without error however accessed
this report raised a number of problems with rna paths, while we still dont have multi-dimensional array access, invalid paths were being accepted which confused things.

rna path resolving code was accepting all sorts of invalid input because atoi() just returns 0 for non numeric input.
now check if 0 number == '0' character.

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	2010-12-01 09:12:54 UTC (rev 33410)
+++ trunk/blender/source/blender/makesrna/intern/rna_access.c	2010-12-01 10:17:31 UTC (rev 33411)
@@ -3047,6 +3047,9 @@
 					else {
 						/* otherwise do int lookup */
 						intkey= atoi(token);
+						if(intkey==0 && (token[0] != '0' || token[1] != '\0')) {
+							return 0; /* we can be sure the fixedbuf was used in this case */
+						}
 						RNA_property_collection_lookup_int(&curptr, prop, intkey, &nextptr);
 					}
 
@@ -3096,6 +3099,9 @@
 					else {
 						/* otherwise do int lookup */
 						*index= atoi(token);
+						if(intkey==0 && (token[0] != '0' || token[1] != '\0')) {
+							return 0; /* we can be sure the fixedbuf was used in this case */
+						}
 					}
 				}
 				else {





More information about the Bf-blender-cvs mailing list