From 3bd0d2e227276f7350dc72e06a43f23001429047 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Fri, 27 Apr 2007 23:54:30 +0000 Subject: Draw.c - error setting the callback button values when using UIBlock (was not offset) BPyMesh.py - own dumb error, was using dir as an arg (which is a py keyword) object_drop.py - new script, the first to use UIBlock, it drops objects into terrain, either a group or the active object. on teh Z axis or view axis. --- source/blender/python/api2_2x/Draw.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/python/api2_2x/Draw.c b/source/blender/python/api2_2x/Draw.c index 7dbcf79a70c..9ff57f247f1 100644 --- a/source/blender/python/api2_2x/Draw.c +++ b/source/blender/python/api2_2x/Draw.c @@ -791,7 +791,11 @@ static void exec_but_callback(PyObject *callback, uiBut *but) printf("Error, no button type matched."); } - PyTuple_SetItem( arg, 0, PyInt_FromLong(but->retval - EXPP_BUTTON_EVENTS_OFFSET) ); + if (uiblock==NULL) + PyTuple_SetItem( arg, 0, PyInt_FromLong(but->retval - EXPP_BUTTON_EVENTS_OFFSET) ); + else + PyTuple_SetItem( arg, 0, PyInt_FromLong(but->retval) ); + PyTuple_SetItem( arg, 1, pyvalue ); result = PyObject_CallObject( callback, arg ); -- cgit v1.2.3