diff options
author | Joshua Leung <aligorith@gmail.com> | 2009-11-26 14:13:10 +0300 |
---|---|---|
committer | Joshua Leung <aligorith@gmail.com> | 2009-11-26 14:13:10 +0300 |
commit | 802cc77f71d6a1deb1e4773f135653f836e84e15 (patch) | |
tree | 9d00299273e07021be27f8de7c6240fb169db6b5 /source/blender/makesrna/RNA_access.h | |
parent | baac1f2267631598613a6f189f45f4a5fea21b9e (diff) |
Patch #20037: Use named components for Drivers instead of array_index
This patch, by Elia Sarti (vekoon), simply adds the possibility to specify the final array component of the RNA path in the path itself,
e.g. using location[0] or location["x"] or even location.x,
instead of specifying this using an "array_index"
This should be easier for users to understand the driver system. The array-indices have been kept (but hidden from the UI under standard situations) since they are theoretically a tad faster than the in-path lookups still, and are easier for internal-tools to set for now...
Diffstat (limited to 'source/blender/makesrna/RNA_access.h')
-rw-r--r-- | source/blender/makesrna/RNA_access.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index d35e5632053..3c420535e2b 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -615,6 +615,7 @@ int RNA_property_array_check(PointerRNA *ptr, PropertyRNA *prop); int RNA_property_multi_array_length(PointerRNA *ptr, PropertyRNA *prop, int dimension); int RNA_property_array_dimension(PointerRNA *ptr, PropertyRNA *prop, int length[]); char RNA_property_array_item_char(PropertyRNA *prop, int index); +int RNA_property_array_item_index(PropertyRNA *prop, char name); int RNA_property_string_maxlength(PropertyRNA *prop); @@ -718,7 +719,10 @@ char *RNA_path_append(const char *path, PointerRNA *ptr, PropertyRNA *prop, char *RNA_path_back(const char *path); int RNA_path_resolve(PointerRNA *ptr, const char *path, - PointerRNA *r_ptr, PropertyRNA **r_prop); + PointerRNA *r_ptr, PropertyRNA **r_prop); + +int RNA_path_resolve_full(PointerRNA *ptr, const char *path, + PointerRNA *r_ptr, PropertyRNA **r_prop, int *index); char *RNA_path_from_ID_to_struct(PointerRNA *ptr); char *RNA_path_from_ID_to_property(PointerRNA *ptr, PropertyRNA *prop); |