diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-04-07 04:49:39 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-04-07 04:49:39 +0400 |
commit | 767db1b71674efb599f03b5892c32d207647acd3 (patch) | |
tree | fc64129bea43fe563bc0ad1448e17405e1b04bb0 /source/blender/makesrna/intern/rna_ID.c | |
parent | 88ab62c03189a04f6a74b040ad269e5a901c4af1 (diff) |
RNA: Commit of the API patch by vekoon. This adds Functions to RNA,
which can be defined to call C functions with defined parameters.
* Parameters are RNA properties, with the same types.
* Parameters are stored in a ParameterList, which is like a small
stack with the values. This is then used to call the C function.
* Includes Python integration.
* Only one test function is part of this commit, ID.rename.
* Integration with the editors/ module is not included in this
commit, there's some issues to be worked out for that still.
Diffstat (limited to 'source/blender/makesrna/intern/rna_ID.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_ID.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index 5955f16f916..cdae8d78ffe 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -167,6 +167,7 @@ static void rna_def_ID(BlenderRNA *brna) { StructRNA *srna; PropertyRNA *prop; + FunctionRNA *func; srna= RNA_def_struct(brna, "ID", NULL); RNA_def_struct_ui_text(srna, "ID", "Base type for datablocks, defining a unique name, linking from other libraries and garbage collection."); @@ -193,6 +194,11 @@ static void rna_def_ID(BlenderRNA *brna) RNA_def_property_pointer_sdna(prop, NULL, "lib"); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Library", "Library file the datablock is linked from."); + + /* XXX temporary for testing */ + func= RNA_def_function(srna, "rename", "rename_id"); + RNA_def_function_ui_description(func, "Rename this ID datablock."); + RNA_def_string(func, "name", "", 0, "", "New name for the datablock."); } static void rna_def_library(BlenderRNA *brna) @@ -212,10 +218,14 @@ void RNA_def_ID(BlenderRNA *brna) { StructRNA *srna; - /* simple built-in unknown type */ + /* built-in unknown type */ srna= RNA_def_struct(brna, "UnknownType", NULL); RNA_def_struct_ui_text(srna, "Unknown Type", "Stub RNA type used for pointers to unknown or internal data."); + /* built-in any type */ + srna= RNA_def_struct(brna, "AnyType", NULL); + RNA_def_struct_ui_text(srna, "Any Type", "RNA type used for pointers to any possible data."); + rna_def_ID(brna); rna_def_ID_properties(brna); rna_def_library(brna); |