]> git.tdb.fi Git - libs/gl.git/commitdiff
Restore the progress bar in the exporter
authorMikko Rasa <tdb@tdb.fi>
Mon, 5 May 2014 19:27:50 +0000 (22:27 +0300)
committerMikko Rasa <tdb@tdb.fi>
Mon, 5 May 2014 20:42:28 +0000 (23:42 +0300)
blender/io_mspgl/export_mesh.py
blender/io_mspgl/util.py

index 39bf87b51e028d97ae24ace20633fbd75879570b..18ae856a927ce8f28b70a45c51ab4ed5b9cfda00 100644 (file)
@@ -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
index 936a1c1dcf0cc16fa9f8c7836fd7b63a8b6e9565..000190fe05e2cb80510121c90afd945378dd3ba6 100644 (file)
@@ -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