From 1ac8a720609d92deba4d91d91a3a8b907a7ad6a8 Mon Sep 17 00:00:00 2001
From: Julien Duroure <julien.duroure@gmail.com>
Date: Fri, 7 Dec 2018 20:07:33 +0100
Subject: [PATCH] Fix T58830 glTF exporter settings

---
 io_scene_gltf2/__init__.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py
index de2462be5..b57c3bf46 100755
--- a/io_scene_gltf2/__init__.py
+++ b/io_scene_gltf2/__init__.py
@@ -274,7 +274,7 @@ class ExportGLTF2_Base:
                     setattr(self, k, v)
                 self.will_save_settings = True
 
-            except AttributeError:
+            except (AttributeError, TypeError):
                 self.report({"ERROR"}, "Loading export settings failed. Removed corrupted settings")
                 del context.scene[self.scene_key]
 
@@ -283,7 +283,7 @@ class ExportGLTF2_Base:
     def save_settings(self, context):
         # find all export_ props
         all_props = self.properties
-        export_props = {x: all_props.get(x) for x in dir(all_props)
+        export_props = {x: getattr(self, x) for x in dir(all_props)
                         if x.startswith("export_") and all_props.get(x) is not None}
 
         context.scene[self.scene_key] = export_props
@@ -521,3 +521,4 @@ def unregister():
     # remove from the export / import menu
     bpy.types.TOPBAR_MT_file_export.remove(menu_func_export)
     bpy.types.TOPBAR_MT_file_import.remove(menu_func_import)
+
-- 
GitLab