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
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2009-10-27 13:14:02 +0300
committerJoshua Leung <aligorith@gmail.com>2009-10-27 13:14:02 +0300
commite61facbf8530f77629e47d4296803948f671c9c7 (patch)
tree496ea63ebe5a32762fa8188635c57c7d48aafff2 /source/blender/makesrna/intern/rna_access.c
parente76ce369bb45f1134b45982ec3ac0a108c9ccf44 (diff)
Bugfix #19729: Color Ramps are not animatable (Part 1)
This first part of the fix makes it possible to animate ramp settings by making sure that the paths for ramps and their elements can be determined. While the code for constructing the path to the ramps is relatively simple, the code for the elements is a bit more involved :/ However, this commit only fixes the paths, but most of the ramp settings still cannot be keyframed directly from the UI buttons/widgets (i.e. from Material/Texture buttons) since the buttons still use the old layouts.
Diffstat (limited to 'source/blender/makesrna/intern/rna_access.c')
-rw-r--r--source/blender/makesrna/intern/rna_access.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_access.c b/source/blender/makesrna/intern/rna_access.c
index f49906554b3..a963c6a18d2 100644
--- a/source/blender/makesrna/intern/rna_access.c
+++ b/source/blender/makesrna/intern/rna_access.c
@@ -1660,6 +1660,25 @@ void RNA_property_collection_clear(PointerRNA *ptr, PropertyRNA *prop)
IDP_ResizeIDPArray(idprop, 0);
}
+int RNA_property_collection_lookup_index(PointerRNA *ptr, PropertyRNA *prop, PointerRNA *t_ptr)
+{
+ CollectionPropertyIterator iter;
+ int index= 0;
+
+ RNA_property_collection_begin(ptr, prop, &iter);
+ for(index=0; iter.valid; RNA_property_collection_next(&iter), index++) {
+ if (iter.ptr.data == t_ptr->data)
+ break;
+ }
+ RNA_property_collection_end(&iter);
+
+ /* did we find it? */
+ if (iter.valid)
+ return index;
+ else
+ return -1;
+}
+
int RNA_property_collection_lookup_int(PointerRNA *ptr, PropertyRNA *prop, int key, PointerRNA *r_ptr)
{
CollectionPropertyRNA *cprop= (CollectionPropertyRNA*)prop;