1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
|
"""The Blender Window module
This module currently only supports redrawing commands of windows.
Later on, it will allow screen manipulations and access to Window
properties"""
import _Blender.Window as _Window
t = _Window.Types
Const = t # emulation
Types = { 'View' : t.VIEW3D,
'Ipo' : t.IPO,
'Oops' : t.OOPS,
'Button' : t.BUTS,
'File' : t.FILE,
'Image' : t.IMAGE,
'Text' : t.TEXT,
'Action' : t.ACTION,
}
del t
def Redraw(t= 'View'):
"""Redraws all windows of the type 't' which must be one of:
* "View" - The 3D view
* "Ipo" - The Ipo Window
* "Oops" - The OOPS (scenegraph) window
* "Button" - The Button Window
* "File" - The File Window
* "Image" - The Image Window (UV editor)
* "Text" - The Text editor
* "Action" - The Action Window"""
if type(t) == type(1):
return _Window.Redraw(t)
try:
_Window.Redraw(Types[t])
except:
raise TypeError, "type must be one of %s" % Types.keys()
def RedrawAll():
"""Redraws the whole screen"""
_Window.RedrawAll()
def drawProgressBar(val, text):
"""Draws a progress bar behind the Blender version information.
'val' is a float value <= 1.0, 'text' contains info about what is currently
being done.
This function must be called with 'val' = 0.0 at start and end of the executed
(and probably time consuming) action.
The user may cancel the progress with the 'Esc' key, in this case, 0 is returned,
1 else."""
return _Window.draw_progressbar(val, text)
draw_progressbar = _Window.draw_progressbar # emulation
QRedrawAll = _Window.QRedrawAll
|