diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-11-26 20:25:06 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-11-26 20:25:06 +0300 |
commit | 16feaf02afbd8eab4c7578aa5bafdf6f9e29cd59 (patch) | |
tree | e4cacb86a19c0e78e880b05c54ef6b28c2a505c7 | |
parent | d6a90a6bff52b5bfeb20f94307a5c81b0ec25d5a (diff) |
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.
-rw-r--r-- | source/blender/makesrna/intern/rna_access.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c index c4b0c6b1373..1cac7aefdfa 100644 --- a/source/blender/makesrna/intern/rna_access.c +++ b/source/blender/makesrna/intern/rna_access.c @@ -530,7 +530,7 @@ int RNA_struct_is_a(StructRNA *type, StructRNA *srna) 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 @@ static char *rna_path_token(const char **path, char *fixedbuf, int fixedlen, int /* 2 kinds of lookups now, quoted or unquoted */ quote= *p; - if(quote != '\'' && quote != '"') + if(quote != '"') quote= 0; if(quote==0) { @@ -2960,14 +2960,6 @@ static int rna_token_strip_quotes(char *token) 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; } |