from .mesh import Mesh
from .util import Progress
- progress = Progress()
+ progress = Progress(context)
progress.set_task("Preparing", 0.0, 0.0)
mesh = None
class Progress:
- def __init__(self):
+ def __init__(self, context):
self.task = ""
self.start = 0.0
self.delta = 1.0
+ self.last = 0.0
+ self.window_manager = context.window_manager
+ self.window_manager.progress_begin(0.0, 1.0)
def set_task(self, task, low, high):
self.task = task
self.start = low
self.delta = high-low
- self.set_progress(0.0)
+ self.set_progress(0)
def set_progress(self, value):
- pass
- #Blender.Window.DrawProgressBar(self.start+self.delta*value, self.task)
+ value = self.start+self.delta*value
+ if value>self.last+0.01:
+ self.window_manager.progress_update(value)
+ self.last = value