3 # ##### BEGIN GPL LICENSE BLOCK #####
5 # This program is free software; you can redistribute it and/or
6 # modify it under the terms of the GNU General Public License
7 # as published by the Free Software Foundation; either version 2
8 # of the License, or (at your option) any later version.
10 # This program is distributed in the hope that it will be useful,
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 # GNU General Public License for more details.
15 # You should have received a copy of the GNU General Public License
16 # along with this program; if not, write to the Free Software Foundation,
17 # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110- 1301, USA.
19 # ##### END GPL LICENSE BLOCK #####
23 # ----------------------------------------------------------
24 # Author: Stephen Leger (s-leger)
25 # Inspired reportpanel.py by Michel Anders
26 # ----------------------------------------------------------
28 from bpy
.props
import FloatProperty
, StringProperty
29 from bpy
.types
import Scene
34 info_header_draw
= None
37 def update(self
, context
):
39 if (context
.window
is not None and
40 context
.window
.screen
is not None and
41 context
.window
.screen
.areas
is not None):
42 areas
= context
.window
.screen
.areas
44 if area
.type == 'INFO':
46 if time() - last_update
> 0.1:
47 bpy
.ops
.wm
.redraw_timer(type='DRAW_WIN_SWAP', iterations
=1)
52 Scene
.archipack_progress
= FloatProperty(
53 options
={'SKIP_SAVE'},
63 Scene
.archipack_progress_text
= StringProperty(
64 options
={'SKIP_SAVE'},
68 global info_header_draw
69 info_header_draw
= bpy
.types
.INFO_HT_header
.draw
71 def info_draw(self
, context
):
72 global info_header_draw
73 info_header_draw(self
, context
)
74 if (context
.scene
.archipack_progress
> -1 and
75 context
.scene
.archipack_progress
< 101):
76 self
.layout
.separator()
77 text
= context
.scene
.archipack_progress_text
78 self
.layout
.prop(context
.scene
,
83 bpy
.types
.INFO_HT_header
.draw
= info_draw
87 del Scene
.archipack_progress
88 del Scene
.archipack_progress_text
89 global info_header_draw
90 bpy
.types
.INFO_HT_header
.draw
= info_header_draw