From 284db61572125c8b2a916a20e5a4333ea72440dc Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Mon, 2 Feb 2009 19:57:57 +0000 Subject: 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 --- source/blender/makesrna/intern/rna_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/blender/makesrna/intern/rna_main.c') diff --git a/source/blender/makesrna/intern/rna_main.c b/source/blender/makesrna/intern/rna_main.c index a3500cecff9..6081147694b 100644 --- a/source/blender/makesrna/intern/rna_main.c +++ b/source/blender/makesrna/intern/rna_main.c @@ -46,11 +46,13 @@ static int rna_Main_filename_length(PointerRNA *ptr) return strlen(bmain->name); } +#if 0 static void rna_Main_filename_set(PointerRNA *ptr, const char *value) { Main *bmain= (Main*)ptr->data; BLI_strncpy(bmain->name, value, sizeof(bmain->name)); } +#endif static void rna_Main_scene_begin(CollectionPropertyIterator *iter, PointerRNA *ptr) { @@ -257,7 +259,7 @@ void RNA_def_main(BlenderRNA *brna) { prop= RNA_def_property(srna, lists[i][0], PROP_COLLECTION, PROP_NONE); RNA_def_property_struct_type(prop, lists[i][1]); - RNA_def_property_collection_funcs(prop, lists[i][2], "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0, 0); + RNA_def_property_collection_funcs(prop, lists[i][2], "rna_iterator_listbase_next", "rna_iterator_listbase_end", "rna_iterator_listbase_get", 0, 0, 0); RNA_def_property_ui_text(prop, lists[i][3], lists[i][4]); } } -- cgit v1.2.3