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_curve.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_curve.c')
-rw-r--r--source/blender/makesrna/intern/rna_curve.c48
1 files changed, 32 insertions, 16 deletions
diff --git a/source/blender/makesrna/intern/rna_curve.c b/source/blender/makesrna/intern/rna_curve.c
index 1f51b84a2c1..4a422cecbd7 100644
--- a/source/blender/makesrna/intern/rna_curve.c
+++ b/source/blender/makesrna/intern/rna_curve.c
@@ -33,41 +33,58 @@
#ifdef RNA_RUNTIME
-
-static float rna_BezTriple_handle1_get(PointerRNA *ptr, int index)
+static void rna_BezTriple_handle1_get(PointerRNA *ptr, float *values)
{
BezTriple *bt= (BezTriple*)ptr->data;
- return bt->vec[0][index];
+
+ values[0]= bt->vec[0][0];
+ values[1]= bt->vec[0][1];
+ values[2]= bt->vec[0][2];
}
-static void rna_BezTriple_handle1_set(PointerRNA *ptr, int index, float value)
+static void rna_BezTriple_handle1_set(PointerRNA *ptr, const float *values)
{
BezTriple *bt= (BezTriple*)ptr->data;
- bt->vec[0][index]= value;
+
+ bt->vec[0][0]= values[0];
+ bt->vec[0][1]= values[1];
+ bt->vec[0][2]= values[2];
}
-static float rna_BezTriple_handle2_get(PointerRNA *ptr, int index)
+static void rna_BezTriple_handle2_get(PointerRNA *ptr, float *values)
{
BezTriple *bt= (BezTriple*)ptr->data;
- return bt->vec[2][index];
+
+ values[0]= bt->vec[2][0];
+ values[1]= bt->vec[2][1];
+ values[2]= bt->vec[2][2];
}
-static void rna_BezTriple_handle2_set(PointerRNA *ptr, int index, float value)
+static void rna_BezTriple_handle2_set(PointerRNA *ptr, const float *values)
{
BezTriple *bt= (BezTriple*)ptr->data;
- bt->vec[2][index]= value;
+
+ bt->vec[2][0]= values[0];
+ bt->vec[2][1]= values[1];
+ bt->vec[2][2]= values[2];
}
-static float rna_BezTriple_ctrlpoint_get(PointerRNA *ptr, int index)
+static void rna_BezTriple_ctrlpoint_get(PointerRNA *ptr, float *values)
{
BezTriple *bt= (BezTriple*)ptr->data;
- return bt->vec[1][index];
+
+ values[0]= bt->vec[1][0];
+ values[1]= bt->vec[1][1];
+ values[2]= bt->vec[1][2];
}
-static void rna_BezTriple_ctrlpoint_set(PointerRNA *ptr, int index, float value)
+static void rna_BezTriple_ctrlpoint_set(PointerRNA *ptr, const float *values)
{
BezTriple *bt= (BezTriple*)ptr->data;
- bt->vec[1][index]= value;
+
+ bt->vec[1][0]= values[0];
+ bt->vec[1][1]= values[1];
+ bt->vec[1][2]= values[2];
}
static int rna_Curve_texspace_editable(PointerRNA *ptr)
@@ -78,8 +95,7 @@ static int rna_Curve_texspace_editable(PointerRNA *ptr)
#else
-
-void rna_def_bpoint(BlenderRNA *brna)
+static void rna_def_bpoint(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;
@@ -120,7 +136,7 @@ void rna_def_bpoint(BlenderRNA *brna)
RNA_def_property_ui_text(prop, "Bevel Radius", "Radius for bevelling");
}
-void rna_def_beztriple(BlenderRNA *brna)
+static void rna_def_beztriple(BlenderRNA *brna)
{
StructRNA *srna;
PropertyRNA *prop;