Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender-addons.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMikhail Rachinskiy <mikhail.rachinskiy@gmail.com>2020-07-23 13:39:19 +0300
committerMikhail Rachinskiy <mikhail.rachinskiy@gmail.com>2020-07-23 13:39:19 +0300
commit089cfd12a5511829aafad3790417a5218955a3ad (patch)
tree88d024c862dc28aa6c4e8b4bc9ef8b2fff610231
parent25b00a0a52c81408b9dc15ea320a79ee956b3c0a (diff)
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.
-rw-r--r--io_mesh_ply/__init__.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/io_mesh_ply/__init__.py b/io_mesh_ply/__init__.py
index 2cfb09c3..1a69c346 100644
--- a/io_mesh_ply/__init__.py
+++ b/io_mesh_ply/__init__.py
@@ -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):