From 9b576665bf488d4a4e113afd761d5caef3ae6f65 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Mon, 15 Sep 2014 13:34:21 +0300 Subject: [PATCH] Add a hidden option to disable progress meter Intended for scripts that call the MSP export operators multiple times. --- blender/io_mspgl/__init__.py | 2 ++ blender/io_mspgl/export_mesh.py | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) 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 = [] -- 2.45.2