[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [33342] trunk/blender/source/blender/ makesrna/intern/rna_access.c: remove support for rna resolving paths with collection['name'], only support collection["name"],

Campbell Barton ideasman42 at gmail.com
Fri Nov 26 18:25:06 CET 2010


Revision: 33342
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=33342
Author:   campbellbarton
Date:     2010-11-26 18:25:06 +0100 (Fri, 26 Nov 2010)

Log Message:
-----------
remove support for rna resolving paths with collection['name'], only support collection["name"],
 added r31826.

This is valid python syntax but I rather be strict with data path format else it becomes harder to parse them if we try to support this.
it means checks like fcurve.data_path.startswith('pose.bones["SomeBone"]') isn't ensured to work, since blender uses "" quotes everywhere for keyframe paths I dont think its an advantage to allow users to do it differently.

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-11-26 17:11:16 UTC (rev 33341)
+++ trunk/blender/source/blender/makesrna/intern/rna_access.c	2010-11-26 17:25:06 UTC (rev 33342)
@@ -530,7 +530,7 @@
 
 PropertyRNA *RNA_struct_find_property(PointerRNA *ptr, const char *identifier)
 {
-	if(identifier[0]=='[' && ELEM(identifier[1], '"', '\'')) { // "  (dummy comment to avoid confusing some function lists in text editors)
+	if(identifier[0]=='[' && identifier[1]=='"') { // "  (dummy comment to avoid confusing some function lists in text editors)
 		/* id prop lookup, not so common */
 		PropertyRNA *r_prop= NULL;
 		PointerRNA r_ptr; /* only support single level props */
@@ -2881,7 +2881,7 @@
 		/* 2 kinds of lookups now, quoted or unquoted */
 		quote= *p;
 
-		if(quote != '\'' && quote != '"')
+		if(quote != '"')
 			quote= 0;
 
 		if(quote==0) {
@@ -2960,14 +2960,6 @@
 			return 1;
 		}
 	}
-	else if(token[0]=='\'') {
-		int len = strlen(token);
-		if (len >= 2 && token[len-1]=='\'') {
-			/* strip away "" */
-			token[len-1]= '\0';
-			return 1;
-		}
-	}
 	return 0;
 }
 





More information about the Bf-blender-cvs mailing list