From: Mikko Rasa Date: Mon, 15 Sep 2014 10:34:21 +0000 (+0300) Subject: Add a hidden option to disable progress meter X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=9b57666;p=libs%2Fgl.git Add a hidden option to disable progress meter Intended for scripts that call the MSP export operators multiple times. --- diff --git a/blender/io_mspgl/__init__.py b/blender/io_mspgl/__init__.py index b7e14fda..38e697b1 100644 --- a/blender/io_mspgl/__init__.py +++ b/blender/io_mspgl/__init__.py @@ -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) diff --git a/blender/io_mspgl/export_mesh.py b/blender/io_mspgl/export_mesh.py index e9724f27..7f6674d3 100644 --- a/blender/io_mspgl/export_mesh.py +++ b/blender/io_mspgl/export_mesh.py @@ -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 = []