diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-03-24 23:47:31 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-03-24 23:47:31 +0400 |
commit | 2d048308c69a7671b43c246ef882f99661dd771d (patch) | |
tree | e2e7624482f7f2c9056bb822102b85b816ee6011 /io_mesh_uv_layout/__init__.py | |
parent | 7e6e45d7a7c80798a21684c278334188cce0e501 (diff) |
remove use of ob.update_from_editmode() since editmode meshes don't get access to customdata layers.
Diffstat (limited to 'io_mesh_uv_layout/__init__.py')
-rw-r--r-- | io_mesh_uv_layout/__init__.py | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/io_mesh_uv_layout/__init__.py b/io_mesh_uv_layout/__init__.py index 07e9e587..dc6c05d5 100644 --- a/io_mesh_uv_layout/__init__.py +++ b/io_mesh_uv_layout/__init__.py @@ -172,7 +172,9 @@ class ExportUVLayout(bpy.types.Operator): def execute(self, context): obj = context.active_object - obj.update_from_editmode() + is_editmode = (obj.mode == 'EDIT') + if is_editmode: + bpy.ops.object.mode_set(mode='OBJECT', toggle=False) mode = self.mode @@ -202,6 +204,9 @@ 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'} |