? blender ? blender_back ? config.opts ? source/blender/python/api2_2x/doc/Armature.pyc ? source/blender/python/api2_2x/doc/BGL.pyc ? source/blender/python/api2_2x/doc/BPY_API_233 ? source/blender/python/api2_2x/doc/Blender.pyc ? source/blender/python/api2_2x/doc/Bone.pyc ? source/blender/python/api2_2x/doc/Camera.pyc ? source/blender/python/api2_2x/doc/Curve.pyc ? source/blender/python/api2_2x/doc/Draw.pyc ? source/blender/python/api2_2x/doc/Effect.pyc ? source/blender/python/api2_2x/doc/Image.pyc ? source/blender/python/api2_2x/doc/Ipo.pyc ? source/blender/python/api2_2x/doc/Lamp.pyc ? source/blender/python/api2_2x/doc/Lattice.pyc ? source/blender/python/api2_2x/doc/Library.pyc ? source/blender/python/api2_2x/doc/Material.pyc ? source/blender/python/api2_2x/doc/Mathutils.pyc ? source/blender/python/api2_2x/doc/Metaball.pyc ? source/blender/python/api2_2x/doc/NLA.pyc ? source/blender/python/api2_2x/doc/NMesh.pyc ? source/blender/python/api2_2x/doc/Noise.pyc ? source/blender/python/api2_2x/doc/Object.pyc ? source/blender/python/api2_2x/doc/Registry.pyc ? source/blender/python/api2_2x/doc/Render.pyc ? source/blender/python/api2_2x/doc/Scene.pyc ? source/blender/python/api2_2x/doc/Sys.pyc ? source/blender/python/api2_2x/doc/Text.pyc ? source/blender/python/api2_2x/doc/Texture.pyc ? source/blender/python/api2_2x/doc/Types.pyc ? source/blender/python/api2_2x/doc/Window.pyc ? source/blender/python/api2_2x/doc/World.pyc Index: source/blender/python/api2_2x/Draw.c =================================================================== RCS file: /cvsroot/bf-blender/blender/source/blender/python/api2_2x/Draw.c,v retrieving revision 1.22 diff -u -r1.22 Draw.c --- source/blender/python/api2_2x/Draw.c 11 Apr 2004 04:41:33 -0000 1.22 +++ source/blender/python/api2_2x/Draw.c 18 May 2004 07:12:41 -0000 @@ -106,6 +106,8 @@ static PyObject *Method_GetStringWidth (PyObject * self, PyObject * args); static PyObject *Method_Text (PyObject * self, PyObject * args); static PyObject *Method_PupMenu (PyObject * self, PyObject * args); +static PyObject *Method_PupIntInput (PyObject * self, PyObject * args); +static PyObject *Method_PupFloatInput (PyObject * self, PyObject * args); static uiBlock *Get_uiBlock (void); static void py_slider_update (void *butv, void *data2_unused); @@ -245,6 +247,13 @@ %xN - The option should set the integer N in the button value.\n\n\ Ex: Draw.PupMenu('OK?%t|QUIT BLENDER') # should be familiar ..."; +static char Method_PupIntInput_doc[] = +"(text, default, min, max) - Display an int pop-up input.\n\ +Return the value selected or None"; + +static char Method_PupFloatInput_doc[] = +"(text, default, min, max, clickStep, floatLen) - Display a float pop-up input.\n\ +Return the value selected or None"; static char Method_Exit_doc[] = "() - Exit the windowing interface"; /* @@ -272,6 +281,8 @@ MethodDef (GetStringWidth), MethodDef (Text), MethodDef (PupMenu), + MethodDef (PupIntInput), + MethodDef (PupFloatInput), MethodDef (Exit), MethodDef (Redraw), MethodDef (Draw), @@ -1060,6 +1071,71 @@ if (ret) return ret; return EXPP_ReturnPyObjError (PyExc_MemoryError, "couldn't create a PyInt"); +} + +static PyObject *Method_PupIntInput (PyObject *self, PyObject *args) +{ + char *text; + int min, max, var; + PyObject *ret; + + if (!PyArg_ParseTuple (args, "s|iii", &text, &var, &min, &max)) + return EXPP_ReturnPyObjError (PyExc_TypeError, + "expected 1 string and 3 int arguments"); + + if(button(&var, min, max, text)==0) + { + Py_INCREF(Py_None); + return Py_None; + } + ret = PyInt_FromLong ( var ); + if (ret) return ret; + + return EXPP_ReturnPyObjError (PyExc_MemoryError, "couldn't create a PyInt"); +} + + +static PyObject *Method_PupFloatInput (PyObject *self, PyObject *args) +{ + char *text; + float min, max, var, a1, a2; + PyObject *ret; + + if (!PyArg_ParseTuple (args, "s|fffff", &text, &var, &min, &max, &a1, &a2)) + return EXPP_ReturnPyObjError (PyExc_TypeError, + "expected 1 string and 5 float arguments"); + + if(fbutton(&var, min, max, a1, a2, text)==0) + { + Py_INCREF(Py_None); + return Py_None; + } + ret = PyFloat_FromDouble ( var ); + if (ret) return ret; + + return EXPP_ReturnPyObjError (PyExc_MemoryError, "couldn't create a PyFloat"); +} + + +static PyObject *Method_PupNumbutInput (PyObject *self, PyObject *args) +{ + char *text; + float min, max, var, a1, a2; + PyObject *ret; + + if (!PyArg_ParseTuple (args, "s|fffff", &text, &var, &min, &max, &a1, &a2)) + return EXPP_ReturnPyObjError (PyExc_TypeError, + "expected 1 string and 5 float arguments"); + + if(fbutton(&var, min, max, a1, a2, text)==0) + { + Py_INCREF(Py_None); + return Py_None; + } + ret = PyFloat_FromDouble ( var ); + if (ret) return ret; + + return EXPP_ReturnPyObjError (PyExc_MemoryError, "couldn't create a PyFloat"); } PyObject *Draw_Init (void) Index: source/blender/python/api2_2x/doc/Draw.py =================================================================== RCS file: /cvsroot/bf-blender/blender/source/blender/python/api2_2x/doc/Draw.py,v retrieving revision 1.7 diff -u -r1.7 Draw.py --- source/blender/python/api2_2x/doc/Draw.py 23 Apr 2004 13:11:48 -0000 1.7 +++ source/blender/python/api2_2x/doc/Draw.py 18 May 2004 07:12:42 -0000 @@ -170,6 +170,71 @@ @return: the chosen entry number or -1 if none was chosen. """ +def PupIntInput(text, default, min, max): + """ + Create a whole number input pop-up. + + This allows python to use blenders whole number popup input. + + Example:: + default = 50 + min = 0 + max = 100 + + result = Draw.PupIntInput('Set this value between 0 and 100', default, min, max) + if result != None: + print result + else: + print 'no user input' + + @type text: string + @param text: The text that is displayed in the popup. + @type default: int + @param default: The value that the popup is set to initialy. + @type min: int + @param min: The lowest value the popup will allow + @type max: int + @param max: The highest value the popup will allow + @rtype: int + @return: the number chosen or None if none was chosen. + """ + +def PupFloatInput(text, default, min, max, clickStep, floatLen): + """ + Create a floating point number input pop-up. + + This allows python to use blenders floating point popup input. + + Example:: + default = 50 + min = 0 + max = 100 + clickStep = 10 + floatLen = 3 + + result = Draw.PupIntInput('Set this value between 0 and 100', default, min, max, clickStep, floatLen) + if result != None: + print result + else: + print 'no user input' + + @type text: string + @param text: The text that is displayed in the popup. + @type default: float + @param default: The value that the popup is set to initialy. + @type min: float + @param min: The lowest value the popup will allow + @type max: float + @param max: The highest value the popup will allow + @type clickStep: int + @param clickStep: How much is incremented per user click, 100 will increment 1.0, 10 will increment 0.1 etc. + @type floatLen: int + @param floatLen: The number of floating points to display, between 2 and 4. + @rtype: float + @return: the number chosen or None if none was chosen. + """ + + def Menu(name, event, x, y, width, height, default, tooltip = None): """ Create a new Menu Button object. Index: source/blender/python/api2_2x/doc/Effect.py =================================================================== RCS file: /cvsroot/bf-blender/blender/source/blender/python/api2_2x/doc/Effect.py,v retrieving revision 1.3 diff -u -r1.3 Effect.py --- source/blender/python/api2_2x/doc/Effect.py 22 Jul 2003 18:11:07 -0000 1.3 +++ source/blender/python/api2_2x/doc/Effect.py 18 May 2004 07:12:44 -0000 @@ -22,12 +22,12 @@ Example:: import Blender - listffects = Blender.Effect.Get() - print listeffects - eff = listeffects[0] - #we suppose the first effect is a build effect - print eff.getLen() - eff.setLen(500) + listffects = Blender.Effect.Get() + print listeffects + eff = listeffects[0] + #we suppose the first effect is a build effect + print eff.getLen() + eff.setLen(500) """ def New (type):