diff options
author | Willian Padovani Germano <wpgermano@gmail.com> | 2006-12-30 21:28:49 +0300 |
---|---|---|
committer | Willian Padovani Germano <wpgermano@gmail.com> | 2006-12-30 21:28:49 +0300 |
commit | 91b2bc5c2344220aa395d5e7d6e2fd5c777b6218 (patch) | |
tree | 8c593d3d29da0b391e3f123dff9743a7266e7847 | |
parent | 822a88959bb2961ec1b5391b1fd01ebbece7b1df (diff) |
Python API:
-Added missing access to Node win theme (thanks Mickaƫl Le-bihan for pointing) and also options group and group_active.
-Added Node space to Window.Types dict.
-Tiny update to the save theme script version numbers (keeping 2.42 for now to avoid popups, but should change to 2.43 right before release).
BTW: Happy New Year everyone :).
-rw-r--r-- | release/scripts/save_theme.py | 9 | ||||
-rw-r--r-- | source/blender/python/api2_2x/Window.c | 1 | ||||
-rw-r--r-- | source/blender/python/api2_2x/windowTheme.c | 22 |
3 files changed, 22 insertions, 10 deletions
diff --git a/release/scripts/save_theme.py b/release/scripts/save_theme.py index 6d19ed81885..981477cdd09 100644 --- a/release/scripts/save_theme.py +++ b/release/scripts/save_theme.py @@ -2,14 +2,14 @@ """ Name: 'Save Current Theme...' -Blender: 240 +Blender: 242 Group: 'Export' Tooltip: 'Save current theme as a BPython script' """ __author__ = "Willian P. Germano" __url__ = ("blender", "elysiun") -__version__ = "2.41 2006/01/16" +__version__ = "2.43 2006/12/30" __bpydoc__ = """\ This script saves the current Theme in Blender as a Blender Python script. @@ -76,6 +76,7 @@ default_fname = Blender.Get("scriptsdir") default_fname = Blender.sys.join(default_fname, theme.name + '_theme.py') default_fname = default_fname.replace(' ','_') type_str = type('') + def write_theme(filename): "Write the current theme as a bpython script" @@ -87,13 +88,13 @@ def write_theme(filename): # \"\"\" # Name: '%s' -# Blender: 243 +# Blender: 242 # Group: 'Themes' # Tooltip: 'Change current theme' # \"\"\" __%s__ = "????" -__%s__ = "2.41" +__%s__ = "2.43" __%s__ = ["blender"] __%s__ = \"\"\"\\ You can edit this section to write something about your script that can diff --git a/source/blender/python/api2_2x/Window.c b/source/blender/python/api2_2x/Window.c index 175e8a7b18b..eaca5e3e5e3 100644 --- a/source/blender/python/api2_2x/Window.c +++ b/source/blender/python/api2_2x/Window.c @@ -1374,6 +1374,7 @@ PyObject *Window_Init( void ) PyConstant_Insert( d, "NLA", PyInt_FromLong( SPACE_NLA ) ); PyConstant_Insert( d, "SCRIPT", PyInt_FromLong( SPACE_SCRIPT ) ); PyConstant_Insert( d, "TIME", PyInt_FromLong( SPACE_TIME ) ); + PyConstant_Insert( d, "NODE", PyInt_FromLong( SPACE_NODE ) ); PyModule_AddObject( submodule, "Types", Types ); } diff --git a/source/blender/python/api2_2x/windowTheme.c b/source/blender/python/api2_2x/windowTheme.c index 985af8b3c11..dfcf26ed5cb 100644 --- a/source/blender/python/api2_2x/windowTheme.c +++ b/source/blender/python/api2_2x/windowTheme.c @@ -47,7 +47,7 @@ #define EXPP_THEME_DRAWTYPE_MIN 1 #define EXPP_THEME_DRAWTYPE_MAX 4 -#define EXPP_THEME_NUMBEROFTHEMES 15 +#define EXPP_THEME_NUMBEROFTHEMES 16 static const EXPP_map_pair themes_map[] = { {"ui", -1}, {"buts", SPACE_BUTS}, @@ -64,6 +64,7 @@ static const EXPP_map_pair themes_map[] = { {"text", SPACE_TEXT}, {"oops", SPACE_OOPS}, {"time", SPACE_TIME}, + {"node", SPACE_NODE}, {NULL, 0} }; @@ -159,9 +160,11 @@ static PyObject *ThemeSpace_getAttr( BPy_ThemeSpace * self, char *name ) ELSEIF_TSP_RGBA( hilite ) ELSEIF_TSP_RGBA( grid ) ELSEIF_TSP_RGBA( wire ) - ELSEIF_TSP_RGBA( lamp ) ELSEIF_TSP_RGBA( select ) + ELSEIF_TSP_RGBA( lamp ) ELSEIF_TSP_RGBA( active ) + ELSEIF_TSP_RGBA( group ) + ELSEIF_TSP_RGBA( group_active ) ELSEIF_TSP_RGBA( transform ) ELSEIF_TSP_RGBA( vertex ) ELSEIF_TSP_RGBA( vertex_select ) @@ -195,17 +198,19 @@ static PyObject *ThemeSpace_getAttr( BPy_ThemeSpace * self, char *name ) else if( !strcmp( name, "facedot_size" ) ) attrib = Py_BuildValue( "i", tsp->facedot_size ); else if( !strcmp( name, "__members__" ) ) - attrib = Py_BuildValue("[sssssssssssssssssssssssssssssssssssssssssss]", "theme", + attrib = Py_BuildValue("[ssssssssssssssssssssssssssssssssssssssssssssss]", "theme", "back", "text", "text_hi", "header", "panel", "shade1", "shade2", "hilite", - "grid", "wire", "lamp", "select", "active", + "grid", "wire", "select", "lamp", "active", + "group", "group_active", "transform", "vertex", "vertex_select", "edge", "edge_select", "edge_seam", "edge_facesel", "face", "face_select", "face_dot", "normal", "bone_solid", "bone_pose", "strip", "strip_select", "syntaxl", "syntaxn", "syntaxb", "syntaxv", "syntaxc", - "movie", "image", "scene", "audio", "effect", "plugin", "transition", "meta", + "movie", "image", "scene", "audio", "effect", "plugin", + "transition", "meta", "vertex_size", "facedot_size" ); if( attrib != Py_None ) @@ -233,9 +238,11 @@ static int ThemeSpace_setAttr( BPy_ThemeSpace * self, char *name, ELSEIF_TSP_RGBA( hilite ) ELSEIF_TSP_RGBA( grid ) ELSEIF_TSP_RGBA( wire ) - ELSEIF_TSP_RGBA( lamp ) ELSEIF_TSP_RGBA( select ) + ELSEIF_TSP_RGBA( lamp ) ELSEIF_TSP_RGBA( active ) + ELSEIF_TSP_RGBA( group ) + ELSEIF_TSP_RGBA( group_active ) ELSEIF_TSP_RGBA( transform ) ELSEIF_TSP_RGBA( vertex ) ELSEIF_TSP_RGBA( vertex_select ) @@ -741,6 +748,9 @@ static PyObject *Theme_get( BPy_Theme * self, PyObject * args ) case SPACE_TIME: tsp = &btheme->ttime; break; + case SPACE_NODE: + tsp = &btheme->tnode; + break; } if( tui ) { |