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).
* Don't call generic layout hints templates anymore, i.e.
TemplateRow becomes Row, etc.
* Added more general layout nesting, using uiLayoutSplit()
and uiLayoutBox() functions, for which the sublayouts
can then be accessed using uiLayoutSub(), to put items
in those sublayouts.
* Some steps to make the layout decisions, like which items
to put in which columns, independent of the width of the
window or the text in the buttons. We want the layout to
be stable under resizes and translations.
* Added an "expand" parameter to uiItemR, used now to expand
enums into a row instead of using a menu.
The bug was todo with bpy.data and bpy.types becoming invalid, temporary fix is to re-assign them to the bpy module before running python operators or panels.
will look into a nicer way to get this working.
this means it caches the compiled pyc files after importing fro the first time.
My times for importing 501 buttons_objects.py files were.
- running each as a script 1.9sec
- importing for the first time 1.8sec
- importing a second time (using pyc files) 0.57sec
Also added "bpy" to sys.modules so it can be imported.
* Added very basic loading of .py files on startup to define panels.
It now executes all .py files in .blender/ui on startup. Right now
this contains the object buttons, the C code for it is commented out.
These files should get embedded in the blender executable as well
eventually, that's a bit more complicated so this works for now.
* For scons and cmake it seems to copy & find the files OK, for make
only "make release" works (same with scripts/ folder it seems).
* Added BLI_gethome_folder function in BLI_util.h. This is adapted
from bpy_gethome, and gives the path to a folder in .blender like
scripts or ui.
There's plenty of things to figure out here about paths, embedding,
caching, user configs ...