Index: source/blender/python/api2_2x/Window.c =================================================================== --- source/blender/python/api2_2x/Window.c (revision 12588) +++ source/blender/python/api2_2x/Window.c (working copy) @@ -106,6 +106,8 @@ static PyObject *M_Window_SetScreen( PyObject * self, PyObject * value ); static PyObject *M_Window_GetScreenInfo( PyObject * self, PyObject * args, PyObject * kwords ); +static PyObject *M_Window_SetPivot( PyObject * self, PyObject * args ); + PyObject *Window_Init( void ); @@ -287,6 +289,15 @@ 'win': window type, see Blender.Window.Types dict;\n\ 'id': area's id."; +static char M_Window_SetPivot_doc[] = + "(Pivot) - Set Pivot Mode for 3D Viewport:\n\ +Options are: \n\ +-0 for Bounding Box Center; \n\ +-1 for 3D Cursor\n\ +-2 for Individual Centers\n\ +-3 for Median Point\n\ +-4 for Active Object"; + /*****************************************************************************/ /* Python method structure definition for Blender.Window module: */ /*****************************************************************************/ @@ -374,6 +385,8 @@ M_Window_SetScreen_doc}, {"GetScreenInfo", ( PyCFunction ) M_Window_GetScreenInfo, METH_VARARGS | METH_KEYWORDS, M_Window_GetScreenInfo_doc}, + {"SetPivot", ( PyCFunction ) M_Window_SetPivot, METH_VARARGS, + M_Window_SetPivot_doc}, {NULL, NULL, 0, NULL} }; @@ -1454,6 +1467,27 @@ return list; } +static PyObject *M_Window_SetPivot( PyObject * self, PyObject * args) + +{ + short pivot; + int ok; + pivot = 0; + + ok = PyArg_ParseTuple(args, "h", &pivot); + if( !ok ) return EXPP_ReturnPyObjError( PyExc_TypeError, + "One argument expected" ); + + if ( pivot > 4 || pivot < 0 ) + return EXPP_ReturnPyObjError( PyExc_AttributeError, + "Invalid argument, should be 0,1,2,3 or 4 " ); + + + if (G.vd) G.vd->around = pivot; + + Py_RETURN_NONE; +} + /*****************************************************************************/ /* Function: Window_Init */ /*****************************************************************************/