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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2009-02-02 22:57:57 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-02-02 22:57:57 +0300
commit284db61572125c8b2a916a20e5a4333ea72440dc (patch)
tree826d68aaccaee0cba7855955cc0e5dcf3a90ef62 /source/blender/makesrna/intern/rna_color.c
parenteb00687cde2fd5724b22a8831d3294f4846ff934 (diff)
RNA: C API
* RNA_blender.h is now generated along with the other files. It is not used anywhere yet, and still located quite hidden next to the other rna_*_gen.c files. Read only access for now. * Inherited properties are not copied from the base anymore but iterated over. Patch by Vekoon, thanks! * Array get/set callbacks now do the whole array instead of getting an index. This is needed for some layers for example so python can set the array as a whole, otherwise the check that one layer has to be enabled at all times gets in the way. Also nicer for the C API. * Also some changes to returning pointers to make the API cleaner, got rid of the type() callback and instead let get() return PointerRNA with the type included. The C API looks like this currently: http://users.pandora.be/blendix/RNA_blender.h
Diffstat (limited to 'source/blender/makesrna/intern/rna_color.c')
-rw-r--r--source/blender/makesrna/intern/rna_color.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c
index e1be99365fe..1009859798d 100644
--- a/source/blender/makesrna/intern/rna_color.c
+++ b/source/blender/makesrna/intern/rna_color.c
@@ -63,17 +63,21 @@ static void rna_CurveMapping_clip_set(PointerRNA *ptr, int value)
curvemapping_changed(cumap, 0);
}
-static void rna_CurveMapping_black_level_set(PointerRNA *ptr, int index, float value)
+static void rna_CurveMapping_black_level_set(PointerRNA *ptr, const float *values)
{
CurveMapping *cumap= (CurveMapping*)ptr->data;
- cumap->black[index]= value;
+ cumap->black[0]= values[0];
+ cumap->black[1]= values[1];
+ cumap->black[2]= values[2];
curvemapping_set_black_white(cumap, NULL, NULL);
}
-static void rna_CurveMapping_white_level_set(PointerRNA *ptr, int index, float value)
+static void rna_CurveMapping_white_level_set(PointerRNA *ptr, const float *values)
{
CurveMapping *cumap= (CurveMapping*)ptr->data;
- cumap->white[index]= value;
+ cumap->white[0]= values[0];
+ cumap->white[1]= values[1];
+ cumap->white[2]= values[2];
curvemapping_set_black_white(cumap, NULL, NULL);
}
@@ -208,7 +212,7 @@ static void rna_def_curvemapping(BlenderRNA *brna)
RNA_def_property_float_funcs(prop, NULL, NULL, "rna_CurveMapping_clipmaxy_range");
prop= RNA_def_property(srna, "curves", PROP_COLLECTION, PROP_NONE);
- RNA_def_property_collection_funcs(prop, "rna_CurveMapping_curves_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", 0, "rna_CurveMapping_curves_length", 0, 0);
+ RNA_def_property_collection_funcs(prop, "rna_CurveMapping_curves_begin", "rna_iterator_array_next", "rna_iterator_array_end", "rna_iterator_array_get", "rna_CurveMapping_curves_length", 0, 0);
RNA_def_property_struct_type(prop, "CurveMap");
RNA_def_property_ui_text(prop, "Curves", "");