]> git.tdb.fi Git - libs/gl.git/blob - blender/io_mspgl/util.py
Set MeshExporter default values to match those in the operator
[libs/gl.git] / blender / io_mspgl / util.py
1 class Progress:
2         def __init__(self, context):
3                 self.task = ""
4                 self.start = 0.0
5                 self.delta = 1.0
6                 self.last = 0.0
7                 self.window_manager = context.window_manager
8                 self.window_manager.progress_begin(0.0, 1.0)
9
10         def set_task(self, task, low, high):
11                 self.task = task
12                 self.start = low
13                 self.delta = high-low
14                 self.set_progress(0)
15
16         def set_progress(self, value):
17                 value = self.start+self.delta*value
18                 if value>self.last+0.01:
19                         self.window_manager.progress_update(value)
20                         self.last = value