diff options
author | Willian Padovani Germano <wpgermano@gmail.com> | 2004-05-23 00:25:22 +0400 |
---|---|---|
committer | Willian Padovani Germano <wpgermano@gmail.com> | 2004-05-23 00:25:22 +0400 |
commit | 7f6b88e3896c1b031ce955a7b52be8d0b8401519 (patch) | |
tree | e13f9e3e8bc23f410c70fa5a1e1957ff8425a923 /source/blender/python/api2_2x/doc/Draw.py | |
parent | 4551490dd44dbd8eae21826842e7e904bed5c288 (diff) |
BPython:
- updated docs with recently added functions
- dynamic menu entries now are sorted (alphabetically, of course)
- added new menu categories for scripts: Wizards, Modifiers, Generators, Materials, Animation:
only added to list of options, didn't mess with any Blender header. They are already available from the "Scripts" menu in the scripts win, but not elsewhere.
- added option 'datadir' to Blender.Get(option):
so scripts can use .blender/bpydata for reading / writing their data files.
Diffstat (limited to 'source/blender/python/api2_2x/doc/Draw.py')
-rw-r--r-- | source/blender/python/api2_2x/doc/Draw.py | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/doc/Draw.py b/source/blender/python/api2_2x/doc/Draw.py index 3c391f93848..0a7b566c273 100644 --- a/source/blender/python/api2_2x/doc/Draw.py +++ b/source/blender/python/api2_2x/doc/Draw.py @@ -170,6 +170,70 @@ def PupMenu(name, maxrow = None): @return: the chosen entry number or -1 if none was chosen. """ +def PupIntInput(text, default, min, max): + """ + Create an integer number input pop-up. + + This allows python to use Blender's integer 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 Blender's 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 decimal places 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. |