Fixes #1 : Wrong context type

This commit is contained in:
ABelliqueux 2021-06-25 18:21:02 +02:00
parent c3522939f5
commit de3d517a57

View File

@ -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):