diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-02-02 22:57:57 +0300 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-02-02 22:57:57 +0300 |
commit | 284db61572125c8b2a916a20e5a4333ea72440dc (patch) | |
tree | 826d68aaccaee0cba7855955cc0e5dcf3a90ef62 /source/blender/blenkernel | |
parent | eb00687cde2fd5724b22a8831d3294f4846ff934 (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/blenkernel')
-rw-r--r-- | source/blender/blenkernel/intern/anim_sys.c | 6 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/fcurve.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index fa3bb335c4f..8bc914d5be0 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -200,19 +200,19 @@ static short animsys_write_rna_setting (PointerRNA *ptr, char *path, int array_i { case PROP_BOOLEAN: if (RNA_property_array_length(&new_ptr, prop)) - RNA_property_boolean_set_array(&new_ptr, prop, array_index, (int)value); + RNA_property_boolean_set_index(&new_ptr, prop, array_index, (int)value); else RNA_property_boolean_set(&new_ptr, prop, (int)value); break; case PROP_INT: if (RNA_property_array_length(&new_ptr, prop)) - RNA_property_int_set_array(&new_ptr, prop, array_index, (int)value); + RNA_property_int_set_index(&new_ptr, prop, array_index, (int)value); else RNA_property_int_set(&new_ptr, prop, (int)value); break; case PROP_FLOAT: if (RNA_property_array_length(&new_ptr, prop)) - RNA_property_float_set_array(&new_ptr, prop, array_index, value); + RNA_property_float_set_index(&new_ptr, prop, array_index, value); else RNA_property_float_set(&new_ptr, prop, value); break; diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index 8c36f2b0017..72e4932e622 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -500,19 +500,19 @@ static float driver_get_driver_value (ChannelDriver *driver, short target) switch (RNA_property_type(&ptr, prop)) { case PROP_BOOLEAN: if (RNA_property_array_length(&ptr, prop)) - value= (float)RNA_property_boolean_get_array(&ptr, prop, index); + value= (float)RNA_property_boolean_get_index(&ptr, prop, index); else value= (float)RNA_property_boolean_get(&ptr, prop); break; case PROP_INT: if (RNA_property_array_length(&ptr, prop)) - value= (float)RNA_property_int_get_array(&ptr, prop, index); + value= (float)RNA_property_int_get_index(&ptr, prop, index); else value= (float)RNA_property_int_get(&ptr, prop); break; case PROP_FLOAT: if (RNA_property_array_length(&ptr, prop)) - value= RNA_property_float_get_array(&ptr, prop, index); + value= RNA_property_float_get_index(&ptr, prop, index); else value= RNA_property_float_get(&ptr, prop); break; |