diff options
author | Campbell Barton <ideasman42@gmail.com> | 2007-02-21 14:17:17 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2007-02-21 14:17:17 +0300 |
commit | f71458b90483e33923e706e1b6aa6612dd0fd425 (patch) | |
tree | 7850f63e7ee8bb4462d7125041434fa35c358a8a /source/blender/python/api2_2x/Text.c | |
parent | 6831c0453371f7b90428686e74b485f76620cf9d (diff) |
adding menu slot Armature
adding menu slot ScriptTemplate
new script scripttemplate_mesh_edit is a template for an editmesh script.
The function Text makeCurrent() is a dummy until I can get it working when the script runs from a menu.
Diffstat (limited to 'source/blender/python/api2_2x/Text.c')
-rw-r--r-- | source/blender/python/api2_2x/Text.c | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/Text.c b/source/blender/python/api2_2x/Text.c index ddfb1b0044f..b0f82bc8f49 100644 --- a/source/blender/python/api2_2x/Text.c +++ b/source/blender/python/api2_2x/Text.c @@ -43,6 +43,11 @@ #include "gen_utils.h" #include "../BPY_extern.h" +/* used only for makeCurrent, this may be deprecated when Blender.Base is implimented */ +#include "BIF_screen.h" +#include "DNA_space_types.h" +#include "DNA_screen_types.h" + #define EXPP_TEXT_MODE_FOLLOW TXT_FOLLOW /*****************************************************************************/ @@ -106,6 +111,7 @@ static PyObject *Text_clear( BPy_Text * self ); static PyObject *Text_write( BPy_Text * self, PyObject * args ); static PyObject *Text_set( BPy_Text * self, PyObject * args ); static PyObject *Text_asLines( BPy_Text * self ); +static PyObject *Text_makeCurrent( BPy_Text * self ); /*****************************************************************************/ /* Python BPy_Text methods table: */ @@ -128,6 +134,8 @@ static PyMethodDef BPy_Text_methods[] = { "(name, val) - Set attribute 'name' to value 'val'"}, {"asLines", ( PyCFunction ) Text_asLines, METH_NOARGS, "() - Return text buffer as a list of lines"}, + {"makeCurrent", ( PyCFunction ) Text_makeCurrent, METH_NOARGS, + "() - display this text."}, {NULL, NULL, 0, NULL} }; @@ -528,6 +536,23 @@ static PyObject *Text_asLines( BPy_Text * self ) return list; } +static PyObject *Text_makeCurrent( BPy_Text * self ) +{ + /* + SpaceText *st= curarea->spacedata.first; + + if( !self->text ) + return EXPP_ReturnPyObjError( PyExc_RuntimeError, + "This object isn't linked to a Blender Text Object" ); + + if(st->spacetype!=SPACE_TEXT) + Py_RETURN_NONE; + + st->text = self->text; + */ + Py_RETURN_NONE; +} + /*****************************************************************************/ /* Function: Text_dealloc */ /* Description: This is a callback function for the BPy_Text type. It is */ |