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 :).
This commit is contained in:
Willian Padovani Germano 2006-12-30 18:28:49 +00:00
parent 822a88959b
commit 91b2bc5c23
3 changed files with 22 additions and 10 deletions

@ -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

@ -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 );
}

@ -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 ) {