PLY: show import/export status with cursor

Later I would like to show progress by percentage, but not yet sure on how to better calculate it and triger update.
This commit is contained in:
Mikhail Rachinskiy 2020-07-23 14:39:19 +04:00
parent 25b00a0a52
commit 089cfd12a5
1 changed files with 8 additions and 3 deletions

View File

@ -84,6 +84,8 @@ class ImportPLY(bpy.types.Operator, ImportHelper):
import os
from . import import_ply
context.window.cursor_set('WAIT')
paths = [
os.path.join(self.directory, name.name)
for name in self.files
@ -95,6 +97,8 @@ class ImportPLY(bpy.types.Operator, ImportHelper):
for path in paths:
import_ply.load(self, context, path)
context.window.cursor_set('DEFAULT')
return {'FINISHED'}
@ -150,6 +154,8 @@ class ExportPLY(bpy.types.Operator, ExportHelper):
from mathutils import Matrix
from . import export_ply
context.window.cursor_set('WAIT')
keywords = self.as_keywords(
ignore=(
"axis_forward",
@ -165,11 +171,10 @@ class ExportPLY(bpy.types.Operator, ExportHelper):
).to_4x4() @ Matrix.Scale(self.global_scale, 4)
keywords["global_matrix"] = global_matrix
filepath = self.filepath
filepath = bpy.path.ensure_ext(filepath, self.filename_ext)
export_ply.save(context, **keywords)
context.window.cursor_set('DEFAULT')
return {'FINISHED'}
def draw(self, context):