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 | |
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')
-rw-r--r-- | source/blender/python/BPY_menus.c | 10 | ||||
-rw-r--r-- | source/blender/python/BPY_menus.h | 2 | ||||
-rw-r--r-- | source/blender/python/api2_2x/Text.c | 25 | ||||
-rw-r--r-- | source/blender/python/api2_2x/Window.c | 1 | ||||
-rw-r--r-- | source/blender/python/api2_2x/doc/Text.py | 7 |
5 files changed, 44 insertions, 1 deletions
diff --git a/source/blender/python/BPY_menus.c b/source/blender/python/BPY_menus.c index 2a53ba1adf1..9b4a5721d4c 100644 --- a/source/blender/python/BPY_menus.c +++ b/source/blender/python/BPY_menus.c @@ -105,6 +105,10 @@ static int bpymenu_group_atoi( char *str ) return PYMENU_VERTEXPAINT; else if( !strcmp( str, "UVCalculation" ) ) return PYMENU_UVCALCULATION; + else if( !strcmp( str, "Armature" ) ) + return PYMENU_ARMATURE; + else if( !strcmp( str, "ScriptTemplate" ) ) + return PYMENU_SCRIPTTEMPLATE; /* "Misc" or an inexistent group name: use misc */ else return PYMENU_MISC; @@ -173,6 +177,12 @@ char *BPyMenu_group_itoa( short menugroup ) case PYMENU_UVCALCULATION: return "UVCalculation"; break; + case PYMENU_ARMATURE: + return "Armature"; + break; + case PYMENU_SCRIPTTEMPLATE: + return "ScriptTemplate"; + break; case PYMENU_MISC: return "Misc"; break; diff --git a/source/blender/python/BPY_menus.h b/source/blender/python/BPY_menus.h index d66f1acf1fc..dfa16853157 100644 --- a/source/blender/python/BPY_menus.h +++ b/source/blender/python/BPY_menus.h @@ -100,6 +100,8 @@ typedef enum { PYMENU_WEIGHTPAINT, PYMENU_VERTEXPAINT, PYMENU_UVCALCULATION, + PYMENU_ARMATURE, + PYMENU_SCRIPTTEMPLATE, PYMENU_HELP,/*Main Help menu items - prob best to leave for 'official' ones*/ PYMENU_HELPSYSTEM,/* Resources, troubleshooting, system tools */ PYMENU_HELPWEBSITES,/* Help -> Websites submenu */ 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 */ diff --git a/source/blender/python/api2_2x/Window.c b/source/blender/python/api2_2x/Window.c index 1aae671708e..ae97ee8b8b4 100644 --- a/source/blender/python/api2_2x/Window.c +++ b/source/blender/python/api2_2x/Window.c @@ -363,7 +363,6 @@ struct PyMethodDef M_Window_methods[] = { PyObject *M_Window_Redraw( PyObject * self, PyObject * args ) { ScrArea *tempsa, *sa; - SpaceText *st; int wintype = SPACE_VIEW3D; short redraw_all = 0; diff --git a/source/blender/python/api2_2x/doc/Text.py b/source/blender/python/api2_2x/doc/Text.py index edb88d0f3f0..ad37de8171c 100644 --- a/source/blender/python/api2_2x/doc/Text.py +++ b/source/blender/python/api2_2x/doc/Text.py @@ -125,3 +125,10 @@ class Text: @rtype: list of strings @return: A list of strings, one for each line in the buffer """ + + def makeCurrent(): + """ + Display this text in the current 3d view if any + @rtype: None + @return: None + """
\ No newline at end of file |