diff options
author | Willian Padovani Germano <wpgermano@gmail.com> | 2004-12-05 07:01:57 +0300 |
---|---|---|
committer | Willian Padovani Germano <wpgermano@gmail.com> | 2004-12-05 07:01:57 +0300 |
commit | a368426d260bd8243eb657cb5a7046e4cc9d9795 (patch) | |
tree | e00586748558e40f6feb718f94c6bbbd4baf1874 /source/blender/python/api2_2x/Window.c | |
parent | 263479dfbadc4e99354e0cf54fb6fa21c900fce5 (diff) |
BPython, two bug fixes:
- #1911: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1911&group_id=9
BOOL properties were returning True always, small mistake in logic.c's getData method.
- #1944: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1944&group_id=9
G.vd was not being checked against NULL in Window.ViewLayer, causing a crash when this function was called from a command line script. Now it returns an error in such cases.
- small doc updates, tiny minor change in Object.c.
Diffstat (limited to 'source/blender/python/api2_2x/Window.c')
-rw-r--r-- | source/blender/python/api2_2x/Window.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/source/blender/python/api2_2x/Window.c b/source/blender/python/api2_2x/Window.c index 1053c29e930..28a17d08936 100644 --- a/source/blender/python/api2_2x/Window.c +++ b/source/blender/python/api2_2x/Window.c @@ -798,7 +798,7 @@ static PyObject *M_Window_GetViewMatrix( PyObject * self ) static PyObject *M_Window_GetPerspMatrix( PyObject * self ) { PyObject *perspmat; - + if( !G.vd ) { Py_INCREF( Py_None ); return Py_None; @@ -847,9 +847,14 @@ static PyObject *M_Window_ViewLayer( PyObject * self, PyObject * args ) PyObject *list = NULL, *resl = NULL; int val, i, bit = 0, layer = 0; + if( !G.vd ) { + return EXPP_ReturnPyObjError( PyExc_RuntimeError, + "this function can only be used after a 3d View has been initialized" ); + } + if( !PyArg_ParseTuple( args, "|O!", &PyList_Type, &list ) ) return EXPP_ReturnPyObjError( PyExc_TypeError, - "expected nothing or a list of ints as argument" ); + "expected nothing or a list of ints as argument" ); if( list ) { for( i = 0; i < PyList_Size( list ); i++ ) { @@ -911,7 +916,7 @@ static PyObject *M_Window_CameraView( PyObject * self, PyObject * args ) if( !G.vd ) return EXPP_ReturnPyObjError( PyExc_RuntimeError, - "View3d not available!" ); + "this function can only be used after a 3d View has been initialized" ); if( !G.vd->camera ) { if( BASACT && OBACT->type == OB_CAMERA ) |