diff options
author | Willian Padovani Germano <wpgermano@gmail.com> | 2005-04-16 09:25:42 +0400 |
---|---|---|
committer | Willian Padovani Germano <wpgermano@gmail.com> | 2005-04-16 09:25:42 +0400 |
commit | d65fc84a6815673b9c4085bd4b3e4830167f59fb (patch) | |
tree | d8b083c5306ea01492f37fb92828fe4a0b42e1b4 /source/blender/python/api2_2x/doc/Draw.py | |
parent | 8b664b924b40aeddc8bc9ac72451a0702af75afe (diff) |
Note: this commit includes new functionality to save and restore scripts configure options. This is ongoing work, scripts still have to be updated to use this feature and more tests are needed, though many have been performed. The new Scripts Config Editor script is the main part of this. If anyone wants to check it, only the AC3D importer and exporter have already been updated to use it: simply open them (you can then cancel with ESC) to have the data created, then try the config editor.
Scripts:
- Thanks Jean-Michel Soler (jms) for updated versions of dispaint, fixfromarmature and unweld (also renamed to remove version part).
- Thanks Bart for the upgraded VRML exporter (great doc webpage!). It is available as VRML 97 and the original VRML 2 is for now still there, to help users testing the new version. For the next release the old one should be removed, of course.
- New script: Scripts Config Editor (Scripts win -> Scripts -> System). Scripts with config options (simple data that is to be set according to user needs or preferences) can use this facility instead of providing a gui and writing config files to disk themselves.
- Added new menu: System, available in the Scripts win.
- Updated sys_info.py, help_browse.py and the AC3D importer and exporter.
- Removed use of the Scrollbar and added arrow keys and mouse wheel support instead in Daniel Dunbar's old doc_browser.py. The scrollbar events handling doesn't exist, Ton suggested removing the scrollbar from the API months ago. For now its ref doc is gone and no bundled script uses it, until we get time to implement it properly.
- Added module BPyRegistry.py with functions to handle reading / writing config files automatically to the scripts/bpydata/config dir.
- Removing dir release/bpydata and its contents (moved earlier to release/scripts/bpydata/)
- Bug #2379: made small changes to bevel_center's ui to fix a problem reported by Alexander Ewering (intrr):
http://projects.blender.org/tracker/?func=detail&atid=125&aid=2379&group_id=9
BPython:
- Thanks Campbell Barton for new functionality: Blender.Get() now can also return all the paths from the user prefs -> file paths win and there is a new function: Blender.sys.expandpath() to transform Blender paths (those starting with '//' and ending with '#') to absolute paths.
- Added function Blender.ShowHelp(), to open the Scripts Help Browser with a given help page -- just a time saver for scripts.
- Improved function Blender.Run() to also work with gui and file select scripts.
- Found a (new?) crash related to NMesh.PutRaw when creating a new object while in edit mode. Leaving / entering edit mode fixes the problem, so a check for obj created, edit mode and leaving / re-entering it were added to the code for now (gdb didn't help much, no backtrace)
- doc updates, including splitting intro page in two, with bpython related stuff (registering / documenting / configuring scripts and command line mode (thanks Chris Want for "use system variables to pass parameters to scripts" idea).
- Registry: functions have been updated to support writing to / reading from disk, for the config editor -- only simple config data supported, for large amounts coders should write to a file themselves. This is done with a new parameter: Registry.GetKey(keyname, True) will also search for the key on the config dir, if not already loaded; equiv. for Registry.SetKey(keyname, dict, True). Data is only written to / read from disk when needed and only scripts already used (assuming they support this functionality) will have config data saved.
Diffstat (limited to 'source/blender/python/api2_2x/doc/Draw.py')
-rw-r--r-- | source/blender/python/api2_2x/doc/Draw.py | 78 |
1 files changed, 47 insertions, 31 deletions
diff --git a/source/blender/python/api2_2x/doc/Draw.py b/source/blender/python/api2_2x/doc/Draw.py index 67d9203b5f5..a3c42c7cdc2 100644 --- a/source/blender/python/api2_2x/doc/Draw.py +++ b/source/blender/python/api2_2x/doc/Draw.py @@ -192,7 +192,23 @@ All available events: - ZEROKEY - ZKEY -@note: function Button has a new alias: L{PushButton}. +@note: function Button has an alias: L{PushButton}. + +@warn: B{very important}: if using your script causes "Error totblock" +messages when Blender exits (meaning that memory has been leaked), this may +have been caused by an ignored return value from one of the button types. To +avoid this, assign created buttons return values to B{global} variables, +instead of ignoring them. Examples:: + + # avoid this, it can cause memory leaks: + Draw.Toggle(...) + Draw.Number(...) + Draw.String(...) + # this is correct -- assuming the variables are globals: + my_toggle_button = Draw.Toggle(...) + my_int_button = Draw.Number(...) + my_str_button = Draw.String(...) + @warn: Inside the windowing loop (after Draw.Register() has been executed and before Draw.Exit() is called), don't use the redraw functions from other @@ -484,36 +500,36 @@ def Slider(name, event, x, y, width, height, initial, min, max, realtime = 1, @return: The Button created. """ -def Scrollbar(event, x, y, width, height, initial, min, max, realtime = 1, - tooltip = None): - """ - Create a new Scrollbar Button object. - @type event: int - @param event: The event number to pass to the button event function when - activated. - @type x: int - @type y: int - @param x: The lower left x (horizontal) coordinate of the button. - @param y: The lower left y (vertical) coordinate of the button. - @type width: int - @type height: int - @param width: The button width. - @param height: The button height. - @type initial: int or float - @type min: int or float - @type max: int or float - @param initial: The initial value. - @param min: The minimum value. - @param max: The maximum value. - @type realtime: int - @param realtime: If non-zero (the default), the slider will emit events as - it is edited. - @type tooltip: string - @param tooltip: The button's tooltip (the string that appears when the mouse - is kept over the button). - @rtype: Blender Button - @return: The Button created. - """ +#def Scrollbar(event, x, y, width, height, initial, min, max, realtime = 1, +# tooltip = None): +# """ +# Create a new Scrollbar Button object. +# @type event: int +# @param event: The event number to pass to the button event function when +# activated. +# @type x: int +# @type y: int +# @param x: The lower left x (horizontal) coordinate of the button. +# @param y: The lower left y (vertical) coordinate of the button. +# @type width: int +# @type height: int +# @param width: The button width. +# @param height: The button height. +# @type initial: int or float +# @type min: int or float +# @type max: int or float +# @param initial: The initial value. +# @param min: The minimum value. +# @param max: The maximum value. +# @type realtime: int +# @param realtime: If non-zero (the default), the slider will emit events as +# it is edited. +# @type tooltip: string +# @param tooltip: The button's tooltip (the string that appears when the mouse +# is kept over the button). +# @rtype: Blender Button +# @return: The Button created. +# """ def Number(name, event, x, y, width, height, initial, min, max, tooltip = None): """ |