diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-04-19 17:37:59 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2009-04-19 17:37:59 +0400 |
commit | adff6aeb1c749183921c0facd373972bbeb874b4 (patch) | |
tree | 07987d408713eee8a3dd8bb5cb4ecf3c112de654 /source/blender/makesrna/RNA_define.h | |
parent | d880257d165888638b7c924fb6ef7071343b783e (diff) |
RNA: Generic Type Registration
The Python API to define Panels and Operators is based on subclassing,
this makes that system more generic, and based on RNA. Hopefully that
will make it easy to make various parts of Blender more extensible.
* The system simply uses RNA properties and functions and marks them
with REGISTER to make them part of the type registration process.
Additionally, the struct must provide a register/unregister callback
to create/free the PanelType or similar.
* From the python side there were some small changes, mainly that
registration now goes trough bpy.types.register instead of
bpy.ui.addPanel.
* Only Panels have been wrapped this way now. Check rna_ui.c to see
how this code works. There's still some rough edges and possibilities
to make it cleaner, though it works without any manual python code.
* Started some docs here:
http://wiki.blender.org/index.php/BlenderDev/Blender2.5/RNATypeRegistration
* Also changed some RNA_property and RNA_struct functions to not
require a PointerRNA anymore, where they were not required (which
is actually the cause of most changed files).
Diffstat (limited to 'source/blender/makesrna/RNA_define.h')
-rw-r--r-- | source/blender/makesrna/RNA_define.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/source/blender/makesrna/RNA_define.h b/source/blender/makesrna/RNA_define.h index aede53aff94..c3c07f34ae0 100644 --- a/source/blender/makesrna/RNA_define.h +++ b/source/blender/makesrna/RNA_define.h @@ -53,6 +53,7 @@ void RNA_def_struct_name_property(StructRNA *srna, PropertyRNA *prop); void RNA_def_struct_nested(BlenderRNA *brna, StructRNA *srna, const char *structname); void RNA_def_struct_flag(StructRNA *srna, int flag); void RNA_def_struct_refine_func(StructRNA *srna, const char *refine); +void RNA_def_struct_register_funcs(StructRNA *srna, const char *reg, const char *unreg); void RNA_def_struct_path_func(StructRNA *srna, const char *path); void RNA_def_struct_identifier(StructRNA *srna, const char *identifier); void RNA_def_struct_ui_text(StructRNA *srna, const char *name, const char *description); |