diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-03-21 18:55:28 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-03-21 18:55:28 +0400 |
commit | c75f170adb9ab2195aaa98122ed02d9332b1b72a (patch) | |
tree | 6785899cb32f0a7a195cb7ea17a15771f18b3cb3 /io_mesh_uv_layout | |
parent | 08e558d60f30781a2c92044e98bcd0e61633f92a (diff) |
use object.update_from_editmode() for scripts which read object data.
Diffstat (limited to 'io_mesh_uv_layout')
-rw-r--r-- | io_mesh_uv_layout/__init__.py | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/io_mesh_uv_layout/__init__.py b/io_mesh_uv_layout/__init__.py index dc6c05d5..07e9e587 100644 --- a/io_mesh_uv_layout/__init__.py +++ b/io_mesh_uv_layout/__init__.py @@ -172,9 +172,7 @@ class ExportUVLayout(bpy.types.Operator): def execute(self, context): obj = context.active_object - is_editmode = (obj.mode == 'EDIT') - if is_editmode: - bpy.ops.object.mode_set(mode='OBJECT', toggle=False) + obj.update_from_editmode() mode = self.mode @@ -204,9 +202,6 @@ class ExportUVLayout(bpy.types.Operator): if self.modified: bpy.data.meshes.remove(mesh) - if is_editmode: - bpy.ops.object.mode_set(mode='EDIT', toggle=False) - file.close() return {'FINISHED'} |