diff options
author | Willian Padovani Germano <wpgermano@gmail.com> | 2004-07-25 20:55:45 +0400 |
---|---|---|
committer | Willian Padovani Germano <wpgermano@gmail.com> | 2004-07-25 20:55:45 +0400 |
commit | c50e3f374fe08713b573559904c5f53d852c5e13 (patch) | |
tree | c5bc2eb290f96c6ad4916de6f5b15c57ffcb79a7 /source/blender/python/api2_2x/doc/Window.py | |
parent | fe9336eb880a1a97121e5f2a6a94c93870d4549b (diff) |
BPython:
- new submodule Scene.Radio, for radiosity: still incomplete, but in shape for demos, updated SConscript to include it;
- new functions in Window module;
- doc updates: adding a todo file and a new start page for our docs: API_intro.py + other updates;
- small fix in Ipo.c provided by Damien McGuinnes (thanks!): Nathan has a patch with IPO additions and fixes for this and more, but until it is committed, there's this fix for Ipo.getCurve('LocX'), LocY, Z and QuatW,X,Y,Z too, according to Damien.
Other files:
- radpreprocess.c: added check for "during_script()" so eventual msgs don't popup during scripts;
- drawmesh.c: made a pointer (display list) be checked before accessed, fixes crash in scripts that forget to update display lists for subsurf meshes when a 3d view is in textured view mode.
Script: updated bevel_center by Loic Berthe.
Diffstat (limited to 'source/blender/python/api2_2x/doc/Window.py')
-rw-r--r-- | source/blender/python/api2_2x/doc/Window.py | 54 |
1 files changed, 46 insertions, 8 deletions
diff --git a/source/blender/python/api2_2x/doc/Window.py b/source/blender/python/api2_2x/doc/Window.py index 3626e38bc09..6ad4971ff86 100644 --- a/source/blender/python/api2_2x/doc/Window.py +++ b/source/blender/python/api2_2x/doc/Window.py @@ -83,9 +83,12 @@ DrawProgressBar:: - SHIFT """ -def Redraw (): +def Redraw (spacetype = '<Types.VIEW3D>'): """ - Force a redraw of a specific Window Type (see L{Types}). + Force a redraw of a specific space type. + @type spacetype: int + @param spacetype: the space type, see L{Types}. By default the 3d Views are + redrawn. If spacetype < 0, all currently visible spaces are redrawn. """ def RedrawAll (): @@ -161,11 +164,27 @@ def GetCursorPos (): def SetCursorPos (coords): """ - Change the 3d cursor position. Note: if visible, the 3d window must be - redrawn to display the change. This can be done with - L{Redraw}(L{Types}['VIEW3D']), for example. + Change the 3d cursor position. @type coords: 3 floats or a list of 3 floats @param coords: The new x, y, z coordinates. + @note: if visible, the 3d View must be redrawn to display the change. This + can be done with L{Redraw}. + """ + +def WaitCursor (bool): + """ + Set cursor to wait or back to normal mode. + + Example:: + Blender.Window.WaitCursor(1) + Blender.sys.sleep(2000) # do something that takes some time + Blender.Window.WaitCursor(0) # back + + @type bool: int (bool) + @param bool: if nonzero the cursor is set to wait mode, otherwise to normal + mode. + @note: when the script finishes execution, the cursor is set to normal by + Blender itself. """ def GetViewVector (): @@ -187,11 +206,14 @@ def EditMode(enable = -1): Get and optionally set the current edit mode status: in or out. Example:: - Window.EditMode(0) # MUST leave edit mode before changing an active mesh + in_editmode = Window.EditMode() + # MUST leave edit mode before changing an active mesh: + if in_editmode: Window.EditMode(0) # ... # make changes to the mesh # ... - Window.EditMode(1) # be nice to the user and return things to how they were + # be nice to the user and return things to how they were: + if in_editmode: Window.EditMode(1) @type enable: int @param enable: get/set current status: - -1: just return current status (default); @@ -315,11 +337,20 @@ def QHandle (winId): def GetMouseCoords (): """ - Get the current mouse screen coordinates. + Get mouse's current screen coordinates. @rtype: list with two ints @return: a [x, y] list with the coordinates. """ +def SetMouseCoords (coords): + """ + Set mouse's current screen coordinates. + @type coords: (list of) two ints + @param coords: can be passed as x, y or [x, y] and are clamped to stay inside + the screen. If not given they default to the coordinates of the middle + of the screen. + """ + def GetMouseButtons (): """ Get the current mouse button state (compare with events from L{Draw}). @@ -360,6 +391,13 @@ def GetAreaSize (): returns for the 'vertices' of the same area. """ +def GetScreenSize (): + """ + Get Blender's screen size. + @rtype: list with two ints + @return: a [width, height] list. + """ + def GetScreens (): """ Get the names of all available screens. |