RNA: Generic Type Registration
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Sun, 19 Apr 2009 13:37:59 +0000 (13:37 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Sun, 19 Apr 2009 13:37:59 +0000 (13:37 +0000)
commitadff6aeb1c749183921c0facd373972bbeb874b4
tree07987d408713eee8a3dd8bb5cb4ecf3c112de654
parentd880257d165888638b7c924fb6ef7071343b783e
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).
39 files changed:
release/ui/buttons_objects.py
release/ui/buttons_scene.py
source/blender/blenkernel/BKE_screen.h
source/blender/blenkernel/intern/anim_sys.c
source/blender/blenkernel/intern/fcurve.c
source/blender/blenkernel/intern/screen.c
source/blender/blenlib/intern/util.c
source/blender/editors/animation/anim_ipo_utils.c
source/blender/editors/animation/drivers.c
source/blender/editors/animation/keyframing.c
source/blender/editors/animation/keyingsets.c
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_anim.c
source/blender/editors/interface/interface_layout.c
source/blender/editors/interface/interface_panel.c
source/blender/editors/interface/interface_regions.c
source/blender/editors/interface/interface_utils.c
source/blender/editors/space_outliner/outliner.c
source/blender/editors/space_text/text_header.c
source/blender/makesrna/RNA_access.h
source/blender/makesrna/RNA_define.h
source/blender/makesrna/RNA_types.h
source/blender/makesrna/intern/makesrna.c
source/blender/makesrna/intern/rna_access.c
source/blender/makesrna/intern/rna_define.c
source/blender/makesrna/intern/rna_internal_types.h
source/blender/makesrna/intern/rna_rna.c
source/blender/makesrna/intern/rna_screen.c
source/blender/makesrna/intern/rna_ui.c
source/blender/python/intern/bpy_operator.c
source/blender/python/intern/bpy_operator_wrap.c
source/blender/python/intern/bpy_panel_wrap.c [deleted file]
source/blender/python/intern/bpy_panel_wrap.h [deleted file]
source/blender/python/intern/bpy_rna.c
source/blender/python/intern/bpy_rna.h
source/blender/python/intern/bpy_ui.c
source/blender/python/intern/bpy_util.c
source/blender/python/intern/bpy_util.h
source/blender/windowmanager/intern/wm_operators.c