From 36ad83bf6558f910a03913dd79ef73d701139f65 Mon Sep 17 00:00:00 2001 From: AJubrey Date: Mon, 27 Nov 2017 14:24:28 -0500 Subject: [PATCH 1/3] [ADDED] function to check for variables in our settings file that could possibly be missing --- Assets/FbxExporters/Editor/FbxExportSettings.cs | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/Assets/FbxExporters/Editor/FbxExportSettings.cs b/Assets/FbxExporters/Editor/FbxExportSettings.cs index ecb7c41e0..2ec9e6dfc 100644 --- a/Assets/FbxExporters/Editor/FbxExportSettings.cs +++ b/Assets/FbxExporters/Editor/FbxExportSettings.cs @@ -1022,8 +1022,9 @@ protected virtual void Load() LoadDefaults(); } else { try { - var fileData = System.IO.File.ReadAllText(filePath); + var fileData = System.IO.File.ReadAllText(filePath); EditorJsonUtility.FromJsonOverwrite(fileData, s_Instance); + checkForNewVariables(fileData); } catch(Exception xcp) { // Quash the exception and take the default settings. Debug.LogException(xcp); @@ -1032,6 +1033,19 @@ protected virtual void Load() } } + /// + /// Check the FBXSettings for any variables we don't know about yet. (in case we are using a new version of the importer) + /// We'll want to update this with any new significant UI options. + /// + /// + private void checkForNewVariables(string FileData) + { + if (!FileData.Contains("HideSendToUnityMenu")) + { + ExportSettings.instance.HideSendToUnityMenu = true; + } + } + protected virtual void Save(bool saveAsText) { if (s_Instance == null) From cb97d07c72e9256452f040ab88f8c6add327e43d Mon Sep 17 00:00:00 2001 From: AJubrey Date: Mon, 27 Nov 2017 16:37:54 -0500 Subject: [PATCH 2/3] [REMOVED] my new function [CHANGED] set the default values for the settings at declaration, this fixes the problem we were having and is simpler than my solution --- .../FbxExporters/Editor/FbxExportSettings.cs | 22 ++++--------------- 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/Assets/FbxExporters/Editor/FbxExportSettings.cs b/Assets/FbxExporters/Editor/FbxExportSettings.cs index 2ec9e6dfc..afef76448 100644 --- a/Assets/FbxExporters/Editor/FbxExportSettings.cs +++ b/Assets/FbxExporters/Editor/FbxExportSettings.cs @@ -330,10 +330,10 @@ public static string[] DCCVendorLocations { } // Note: default values are set in LoadDefaults(). - public bool mayaCompatibleNames; - public bool centerObjects; - public bool launchAfterInstallation; - public bool HideSendToUnityMenu; + public bool mayaCompatibleNames = true; + public bool centerObjects = true; + public bool launchAfterInstallation = true; + public bool HideSendToUnityMenu = true; public int ExportFormatSelection; public string IntegrationSavePath; @@ -1024,7 +1024,6 @@ protected virtual void Load() try { var fileData = System.IO.File.ReadAllText(filePath); EditorJsonUtility.FromJsonOverwrite(fileData, s_Instance); - checkForNewVariables(fileData); } catch(Exception xcp) { // Quash the exception and take the default settings. Debug.LogException(xcp); @@ -1033,19 +1032,6 @@ protected virtual void Load() } } - /// - /// Check the FBXSettings for any variables we don't know about yet. (in case we are using a new version of the importer) - /// We'll want to update this with any new significant UI options. - /// - /// - private void checkForNewVariables(string FileData) - { - if (!FileData.Contains("HideSendToUnityMenu")) - { - ExportSettings.instance.HideSendToUnityMenu = true; - } - } - protected virtual void Save(bool saveAsText) { if (s_Instance == null) From fa7d56940c937adae6137c8cfff898b4acbfd2b9 Mon Sep 17 00:00:00 2001 From: AJubrey Date: Mon, 27 Nov 2017 16:43:14 -0500 Subject: [PATCH 3/3] [REMOVED] extra spaces --- Assets/FbxExporters/Editor/FbxExportSettings.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/FbxExporters/Editor/FbxExportSettings.cs b/Assets/FbxExporters/Editor/FbxExportSettings.cs index afef76448..3048d1c75 100644 --- a/Assets/FbxExporters/Editor/FbxExportSettings.cs +++ b/Assets/FbxExporters/Editor/FbxExportSettings.cs @@ -1022,7 +1022,7 @@ protected virtual void Load() LoadDefaults(); } else { try { - var fileData = System.IO.File.ReadAllText(filePath); + var fileData = System.IO.File.ReadAllText(filePath); EditorJsonUtility.FromJsonOverwrite(fileData, s_Instance); } catch(Exception xcp) { // Quash the exception and take the default settings.