From 820d8ff86b911f1119b8cde03839687176b9b1ee Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 5 May 2014 22:27:50 +0300 Subject: [PATCH] Restore the progress bar in the exporter --- blender/io_mspgl/export_mesh.py | 2 +- blender/io_mspgl/util.py | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/blender/io_mspgl/export_mesh.py b/blender/io_mspgl/export_mesh.py index 39bf87b5..18ae856a 100644 --- a/blender/io_mspgl/export_mesh.py +++ b/blender/io_mspgl/export_mesh.py @@ -206,7 +206,7 @@ class MeshExporter: from .mesh import Mesh from .util import Progress - progress = Progress() + progress = Progress(context) progress.set_task("Preparing", 0.0, 0.0) mesh = None diff --git a/blender/io_mspgl/util.py b/blender/io_mspgl/util.py index 936a1c1d..000190fe 100644 --- a/blender/io_mspgl/util.py +++ b/blender/io_mspgl/util.py @@ -1,15 +1,20 @@ 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 -- 2.45.2