Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2011-03-30 15:51:06 +0400
committerCampbell Barton <ideasman42@gmail.com>2011-03-30 15:51:06 +0400
commita462f7880b3927612553dbd86cdb4d73fb74a204 (patch)
tree6e130e75fa3a9057eccf5238246dac79fd318f3c /source
parent2b79378f81d42049192fca47910a2db91e1d85a1 (diff)
disallow rna paths resolving to upper case X/Y/Z/X / R/G/B/A, python cant resolve these.
Diffstat (limited to 'source')
-rw-r--r--source/blender/makesrna/intern/rna_access.c26
1 files changed, 12 insertions, 14 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index 4ca73f81965..aabb2c92996 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -778,43 +778,41 @@ int RNA_property_array_item_index(PropertyRNA *prop, char name)
{
PropertySubType subtype= rna_ensure_property(prop)->subtype;
- name= toupper(name);
-
/* get index based on string name/alias */
/* maybe a function to find char index in string would be better than all the switches */
if (ELEM(subtype, PROP_QUATERNION, PROP_AXISANGLE)) {
switch (name) {
- case 'W':
+ case 'w':
return 0;
- case 'X':
+ case 'x':
return 1;
- case 'Y':
+ case 'y':
return 2;
- case 'Z':
+ case 'z':
return 3;
}
}
else if(ELEM6(subtype, PROP_TRANSLATION, PROP_DIRECTION, PROP_XYZ, PROP_EULER, PROP_VELOCITY, PROP_ACCELERATION)) {
switch (name) {
- case 'X':
+ case 'x':
return 0;
- case 'Y':
+ case 'y':
return 1;
- case 'Z':
+ case 'z':
return 2;
- case 'W':
+ case 'w':
return 3;
}
}
else if (ELEM(subtype, PROP_COLOR, PROP_COLOR_GAMMA)) {
switch (name) {
- case 'R':
+ case 'r':
return 0;
- case 'G':
+ case 'g':
return 1;
- case 'B':
+ case 'b':
return 2;
- case 'A':
+ case 'a':
return 3;
}
}