diff options
author | Campbell Barton <ideasman42@gmail.com> | 2006-12-30 10:32:58 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2006-12-30 10:32:58 +0300 |
commit | 5af67129f8d3c2245772a55e5fa5ea4cd0653477 (patch) | |
tree | 35db18fe4fe34aeacaf7b3370ca35d9a936e5bf9 /source/blender/python/api2_2x/Blender.c | |
parent | 26719af48a9e6b28dbfdba608cbb2fe780f629c7 (diff) |
* theme save script now saves iconThemes and supports string types.
* added .iconTheme variable
* bugfix. drawType was not being saved because Py_BuildValue and __members__ was missing an "s"
* added Blender.Get('icondir')
Diffstat (limited to 'source/blender/python/api2_2x/Blender.c')
-rw-r--r-- | source/blender/python/api2_2x/Blender.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/source/blender/python/api2_2x/Blender.c b/source/blender/python/api2_2x/Blender.c index 684ad6b17d2..1323af16b8a 100644 --- a/source/blender/python/api2_2x/Blender.c +++ b/source/blender/python/api2_2x/Blender.c @@ -477,7 +477,23 @@ static PyObject *Blender_Get( PyObject * self, PyObject * args ) ret = PyString_FromString( tempdir ); } if (!ret) ret = EXPP_incr_ret(Py_None); - } + } + /* icondir */ + else if( StringEqual( str, "icondir" ) ) { + + char icondirstr[FILE_MAXDIR]; + + #ifdef WIN32 + BLI_make_file_string("/", icondirstr, BLI_gethome(), "icons"); + #else + BLI_make_file_string("/", icondirstr, BLI_gethome(), ".blender/icons"); + #endif + + if( BLI_exists( icondirstr ) ) + ret = PyString_FromString( icondirstr ); + + if (!ret) ret = EXPP_incr_ret(Py_None); + } /* According to the old file (opy_blender.c), the following if statement is a quick hack and needs some clean up. */ else if( StringEqual( str, "vrmloptions" ) ) { |