diff --git a/io_export_psx_tmesh.py b/io_export_psx_tmesh.py index ce584f5..12a08f5 100644 --- a/io_export_psx_tmesh.py +++ b/io_export_psx_tmesh.py @@ -633,12 +633,12 @@ class ExportMyFormat(bpy.types.Operator, ExportHelper): TIMshift = 2 + # Set context area to 3d view + previousAreaType = bpy.context.area.type + bpy.context.area.type="VIEW_3D" # Leave edit mode to avoid errors - bpy.ops.object.mode_set(mode='OBJECT') - # If set, triangulate objects of type mesh - if self.exp_Triangulate: for o in range(len(bpy.data.objects)): @@ -2856,6 +2856,9 @@ class ExportMyFormat(bpy.types.Operator, ExportHelper): h.close() + # Restore previous area type + bpy.context.area.type = previousAreaType + return {'FINISHED'}; def menu_func(self, context):