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/blenlib | |
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/blenlib')
-rw-r--r-- | source/blender/blenlib/intern/util.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/source/blender/blenlib/intern/util.c b/source/blender/blenlib/intern/util.c index 3d55a048d5f..137a32c4689 100644 --- a/source/blender/blenlib/intern/util.c +++ b/source/blender/blenlib/intern/util.c @@ -848,6 +848,12 @@ char *BLI_gethome_folder(char *folder_name) char *s; int i; + /* use argv[0] (bprogname) to get the path to the executable */ + s = BLI_last_slash(bprogname); + + i = s - bprogname + 1; + BLI_strncpy(bprogdir, bprogname, i); + /* try path_to_executable/release/folder_name (in svn) */ if (folder_name) { BLI_snprintf(tmpdir, sizeof(tmpdir), "release/%s", folder_name); @@ -889,16 +895,6 @@ char *BLI_gethome_folder(char *folder_name) else homedir[0] = '\0'; - /* if either: - * no homedir was found or - * folder_name = 1 but there's no folder_name/ inside homedir, - * use argv[0] (bprogname) to get .blender/ in - * Blender's installation dir */ - s = BLI_last_slash(bprogname); - - i = s - bprogname + 1; - BLI_strncpy(bprogdir, bprogname, i); - /* using tmpdir to preserve homedir (if) found above: * the ideal is to have a home dir with folder_name dir inside * it, but if that isn't available, it's possible to |