]> git.tdb.fi Git - libs/gl.git/commitdiff
Add a hidden option to disable progress meter
authorMikko Rasa <tdb@tdb.fi>
Mon, 15 Sep 2014 10:34:21 +0000 (13:34 +0300)
committerMikko Rasa <tdb@tdb.fi>
Mon, 15 Sep 2014 10:34:21 +0000 (13:34 +0300)
Intended for scripts that call the MSP export operators multiple times.

blender/io_mspgl/__init__.py
blender/io_mspgl/export_mesh.py

index b7e14fdad19d0bae3ae027c31f67fb6f87ed38a4..38e697b1c4a651390717da0c236f8d735eddd514 100644 (file)
@@ -15,6 +15,8 @@ import bpy
 from bpy_extras.io_utils import ExportHelper
 
 class ExportMspGLBase(ExportHelper):
+       show_progress = bpy.props.BoolProperty(name="Show progress", description="Display progress indicator while exporting", default=True)
+
        def execute(self, context):
                exporter = self.create_exporter()
                self.prepare_exporter(exporter)
index e9724f27f3d94166469099df98b70cfed1c09b87..7f6674d31beacd7988d0d01147608cd9a9710c68 100644 (file)
@@ -34,6 +34,7 @@ class VertexCache:
 
 class MeshExporter:
        def __init__(self):
+               self.show_progress = True
                self.use_strips = True
                self.use_degen_tris = False
                self.max_strip_len = 1024
@@ -216,9 +217,12 @@ class MeshExporter:
                from .mesh import Mesh
                from .util import Progress
 
-               if not progress:
-                       progress = Progress(context)
-               progress.set_task("Preparing", 0.0, 0.0)
+               if self.show_progress:
+                       if not progress:
+                               progress = Progress(context)
+                       progress.set_task("Preparing", 0.0, 0.0)
+               else:
+                       progress = None
 
                mesh = None
                bmeshes = []