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/Object.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/Object.c')
-rw-r--r-- | source/blender/python/api2_2x/Object.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/source/blender/python/api2_2x/Object.c b/source/blender/python/api2_2x/Object.c index ec352061268..afc093a6965 100644 --- a/source/blender/python/api2_2x/Object.c +++ b/source/blender/python/api2_2x/Object.c @@ -1799,15 +1799,16 @@ static PyObject *Object_addProperty( BPy_Object * self, PyObject * args ) char *prop_type = NULL; short type = -1; BPy_Property *py_prop = NULL; + int argslen = PyObject_Length( args ); - if( PyObject_Length( args ) == 3 || PyObject_Length( args ) == 2 ) { + if( argslen == 3 || argslen == 2 ) { if( !PyArg_ParseTuple ( args, "sO|s", &prop_name, &prop_data, &prop_type ) ) { return ( EXPP_ReturnPyObjError ( PyExc_AttributeError, "unable to get string, data, and optional string" ) ); } - } else if( PyObject_Length( args ) == 1 ) { + } else if( argslen == 1 ) { if( !PyArg_ParseTuple( args, "O!", &property_Type, &py_prop ) ) { return ( EXPP_ReturnPyObjError( PyExc_AttributeError, "unable to get Property" ) ); |