X-Git-Url: http://git.tdb.fi/?p=libs%2Fgl.git;a=blobdiff_plain;f=blender%2Fio_mspgl%2Fexport_mesh.py;h=39619f8bc02dd7fb0ff7cf3ac9a98d50a57820ba;hp=6d90c8faf6d5f435ac4daec803e8a02cb0200b86;hb=dc2e08621ad586663e4c11475f03886a91463907;hpb=211d5ec0e55778ab023b1bc6bb54e2c9afa7df0c diff --git a/blender/io_mspgl/export_mesh.py b/blender/io_mspgl/export_mesh.py index 6d90c8fa..39619f8b 100644 --- a/blender/io_mspgl/export_mesh.py +++ b/blender/io_mspgl/export_mesh.py @@ -130,8 +130,7 @@ class MeshExporter: cache.fetch_strip(strip) faces_done += len(island) - if progress: - progress.set_progress(float(faces_done)/len(mesh.faces)) + progress.set_progress(faces_done/len(mesh.faces)) # Collect any faces that weren't used in strips loose += [f for f in island if not f.flag] @@ -195,24 +194,19 @@ class MeshExporter: from .mesh import create_mesh_from_object from .util import Progress - if self.show_progress: - if not progress: - progress = Progress(context) - progress.set_task("Preparing", 0.0, 0.0) - else: - progress = None + if not progress: + progress = Progress(self.show_progress and context) + progress.push_task("", 0.0, 0.65) mesh = create_mesh_from_object(context, obj, progress) strips = [] loose = mesh.faces if self.use_strips: - if progress: - progress.set_task("Creating strips", 0.65, 0.95) + progress.set_task("Creating strips", 0.65, 0.95) strips, loose = self.stripify(mesh, progress) - if progress: - progress.set_task("Writing file", 0.95, 1.0) + progress.set_task("Writing file", 0.95, 1.0) from .outfile import open_output out_file = open_output(out_file) @@ -294,7 +288,6 @@ class MeshExporter: if mesh.winding_test: out_file.write("winding", "COUNTERCLOCKWISE") - if progress: - progress.set_task("Done", 1.0, 1.0) + progress.pop_task() return mesh