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/makesrna/intern/rna_lamp.c | |
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/makesrna/intern/rna_lamp.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_lamp.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/makesrna/intern/rna_lamp.c b/source/blender/makesrna/intern/rna_lamp.c index 0f3612e2049..80b7658c6ef 100644 --- a/source/blender/makesrna/intern/rna_lamp.c +++ b/source/blender/makesrna/intern/rna_lamp.c @@ -46,9 +46,9 @@ static void rna_Lamp_buffer_size_set(PointerRNA *ptr, int value) la->bufsize &= (~15); /* round to multiple of 16 */ } -static void *rna_Lamp_sky_settings_get(PointerRNA *ptr) +static PointerRNA rna_Lamp_sky_settings_get(PointerRNA *ptr) { - return ptr->id.data; + return rna_pointer_inherit_refine(ptr, &RNA_LampSkySettings, ptr->id.data); } static void rna_Lamp_mtex_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) @@ -57,10 +57,10 @@ static void rna_Lamp_mtex_begin(CollectionPropertyIterator *iter, PointerRNA *pt rna_iterator_array_begin(iter, (void*)la->mtex, sizeof(MTex*), MAX_MTEX, NULL); } -static void *rna_Lamp_active_texture_get(PointerRNA *ptr) +static PointerRNA rna_Lamp_active_texture_get(PointerRNA *ptr) { Lamp *la= (Lamp*)ptr->data; - return la->mtex[(int)la->texact]; + return rna_pointer_inherit_refine(ptr, &RNA_TextureSlot, la->mtex[(int)la->texact]); } static StructRNA* rna_Lamp_refine(struct PointerRNA *ptr) @@ -645,7 +645,7 @@ static void rna_def_sun_lamp(BlenderRNA *brna) /* sky */ prop= RNA_def_property(srna, "sky", PROP_POINTER, PROP_NEVER_NULL); RNA_def_property_struct_type(prop, "LampSkySettings"); - RNA_def_property_pointer_funcs(prop, "rna_Lamp_sky_settings_get", NULL, NULL); + RNA_def_property_pointer_funcs(prop, "rna_Lamp_sky_settings_get", NULL); RNA_def_property_ui_text(prop, "Sky Settings", "Sky related settings for sun lamps."); } |