Skip to content

Commit

Permalink
Merge pull request KhronosGroup#1922 from KhronosGroup/fix_filter_sav…
Browse files Browse the repository at this point in the history
…ed_settings

Fix KhronosGroup#1921 - saved setting filter file type
  • Loading branch information
julienduroure authored May 23, 2023
2 parents c2125c2 + 87be2a3 commit e3eecfb
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion addons/io_scene_gltf2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def on_export_format_changed(self, context):

# Also change the filter
sfile.params.filter_glob = '*.glb' if self.export_format == 'GLB' else '*.gltf'
# Force update of file list, has update the filter does not update the real file list
# Force update of file list, because update the filter does not update the real file list
bpy.ops.file.refresh()


Expand Down Expand Up @@ -640,6 +640,10 @@ def invoke(self, context, event):
setattr(self, k, v)
self.will_save_settings = True

# Update filter if user saved settings
if hasattr(self, 'export_format'):
self.filter_glob = '*.glb' if self.export_format == 'GLB' else '*.gltf'

except (AttributeError, TypeError):
self.report({"ERROR"}, "Loading export settings failed. Removed corrupted settings")
del context.scene[self.scene_key]
Expand Down

0 comments on commit e3eecfb

Please sign in to comment.