Skip to content
Snippets Groups Projects
Commit c5a84e2e authored by Julien Duroure's avatar Julien Duroure
Browse files

gltf exporter: Fix T83188: avoid crash when background exporting (without UI)

parent 515d85d3
No related branches found
No related tags found
No related merge requests found
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
bl_info = { bl_info = {
'name': 'glTF 2.0 format', 'name': 'glTF 2.0 format',
'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors', 'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
"version": (1, 5, 6), "version": (1, 5, 7),
'blender': (2, 91, 0), 'blender': (2, 91, 0),
'location': 'File > Import-Export', 'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0', 'description': 'Import-Export as glTF 2.0',
...@@ -73,6 +73,8 @@ extension_panel_unregister_functors = [] ...@@ -73,6 +73,8 @@ extension_panel_unregister_functors = []
def on_export_format_changed(self, context): def on_export_format_changed(self, context):
# Update the file extension when the format (.glb/.gltf) changes # Update the file extension when the format (.glb/.gltf) changes
sfile = context.space_data sfile = context.space_data
if sfile is None:
return # Avoid error when export from background
operator = sfile.active_operator operator = sfile.active_operator
if operator.bl_idname != "EXPORT_SCENE_OT_gltf": if operator.bl_idname != "EXPORT_SCENE_OT_gltf":
return return
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment