diff options
author | Daniel Genrich <daniel.genrich@gmx.net> | 2008-06-30 19:02:22 +0400 |
---|---|---|
committer | Daniel Genrich <daniel.genrich@gmx.net> | 2008-06-30 19:02:22 +0400 |
commit | 90c2c290587ac74eac310fd407adf5ffe1a2f619 (patch) | |
tree | 82e57f8b66432ac66a13106ad41350999bc63914 /source/blender | |
parent | 5b15a610ee2688a42f24b6ef16a7fce5a4aa96df (diff) |
Fix for python APi error - (Campbell: please check :) ) -- using myLamp.setType(Area) resulted in 'TypeError: expected int argument in [0,5]' (reported in IRC by Djoef)
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/python/api2_2x/Lamp.c | 11 | ||||
-rw-r--r-- | source/blender/src/buttons_logic.c | 2 |
2 files changed, 4 insertions, 9 deletions
diff --git a/source/blender/python/api2_2x/Lamp.c b/source/blender/python/api2_2x/Lamp.c index d9034847a85..53d25a6429d 100644 --- a/source/blender/python/api2_2x/Lamp.c +++ b/source/blender/python/api2_2x/Lamp.c @@ -1520,14 +1520,9 @@ static PyObject *Lamp_oldsetType( BPy_Lamp * self, PyObject * value ) char *type = PyString_AsString(value); PyObject *arg, *error; - /* parse string argument */ - - if( !value ) - return ( EXPP_ReturnPyObjError( PyExc_TypeError, - "expected string argument" ) ); - + /* parse string argument */ if( !type ) - return EXPP_ReturnPyObjError ( PyExc_AttributeError, + return EXPP_ReturnPyObjError ( PyExc_TypeError, "expected string argument" ); /* check for valid arguments, set type accordingly */ @@ -1550,7 +1545,7 @@ static PyObject *Lamp_oldsetType( BPy_Lamp * self, PyObject * value ) /* build tuple, call wrapper */ - arg = Py_BuildValue( "(i)", type ); + arg = Py_BuildValue( "(i)", self->lamp->type ); error = EXPP_setterWrapper ( (void *)self, arg, (setter)Lamp_setType ); Py_DECREF ( arg ); return error; diff --git a/source/blender/src/buttons_logic.c b/source/blender/src/buttons_logic.c index 3b545697f8e..4e5e8a605ee 100644 --- a/source/blender/src/buttons_logic.c +++ b/source/blender/src/buttons_logic.c @@ -1703,7 +1703,7 @@ static short draw_actuatorbuttons(Object *ob, bActuator *act, uiBlock *block, sh } uiDefButI(block, NUM, 0, "Blendin: ", xco+30, yco-64, (width-60)/2, 19, &aa->blendin, 0.0, MAXFRAMEF, 0.0, 0.0, "Number of frames of motion blending"); - uiDefButS(block, NUM, 0, "Priority: ", xco+30+(width-60)/2, yco-64, (width-60)/2, 19, &aa->priority, 0.0, 100.0, 0.0, 0.0, "Execution priority - lower numbers will override actions with higher numbers, With 2 or more actions at once, the overriding clannels must be lower in the stack"); + uiDefButS(block, NUM, 0, "Priority: ", xco+30+(width-60)/2, yco-64, (width-60)/2, 19, &aa->priority, 0.0, 100.0, 0.0, 0.0, "Execution priority - lower numbers will override actions with higher numbers, With 2 or more actions at once, the overriding channels must be lower in the stack"); uiDefBut(block, TEX, 0, "FrameProp: ",xco+30, yco-84, width-60, 19, aa->frameProp, 0.0, 31.0, 0, 0, "Assign this property this actions current frame number"); |