Fixes #1 : Wrong context type
This commit is contained in:
parent
c3522939f5
commit
de3d517a57
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user