Unity
Unity copied to clipboard
fbx importer broken thanks to 2018.2+ specific code
Github-for-Unity v 1.2.1 Unity 2018.2.1f1
The animation import settings for fbx files are broken thanks to a few lines of code in UnityAPIWrapper.cs:
Editor.finishedDefaultHeaderGUI += editor => { UnityShim.Raise_Editor_finishedDefaultHeaderGUI(editor); };
(this is wrapped in an #if UNITY_2018_2_OR_NEWER block)
If I comment these lines out, everything is fine.
The console throws this error when viewing an fbx's animation import page:
InvalidOperationException: Stack empty. System.Collections.Generic.Stack1[T].ThrowForEmptyStack () (at <343bdfbb3c2d4d21b745a87548c1a7cd>:0)
System.Collections.Generic.Stack1[T].Pop () (at <343bdfbb3c2d4d21b745a87548c1a7cd>:0) UnityEditor.EditorGUI.EndChangeCheck () (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:315) UnityEditor.ModelImporterClipEditor.AnimationSplitTable () (at C:/buildslave/unity/build/Editor/Mono/ImportSettings/ModelImporterClipEditor.cs:699) UnityEditor.ModelImporterClipEditor.AnimationClipGUI () (at C:/buildslave/unity/build/Editor/Mono/ImportSettings/ModelImporterClipEditor.cs:372) UnityEditor.ModelImporterClipEditor.OnInspectorGUI () (at C:/buildslave/unity/build/Editor/Mono/ImportSettings/ModelImporterClipEditor.cs:448) UnityEditor.AssetImporterTabbedEditor.OnInspectorGUI () (at C:/buildslave/unity/build/Editor/Mono/Inspector/TabbedEditor.cs:147) UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor[] editors, System.Int32 editorIndex, System.Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1374) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
... and the whole thing might be related to this issue (though I can't really make sense of it): https://issuetracker.unity3d.com/issues/stack-empty-exception-is-thrown-with-net-4-dot-x-when-compiling-a-script-with-without-a-space-after-the-number-if-logic
Same file breaking in Unity 2019.1.2f1 Github-for-Unity v 1.2.1
Applied the same fix and it started working.
Console throws the following error when lines 14-16 are not commented out:
Assets\Plugins\GitHub\Editor\UnityAPIWrapper.cs(16,17): error CS0103: The name 'UnityShim' does not exist in the current context
Any update? have the same issue.
I'm not having this problem personally but I guy on the game team ran into this problem on 2019.4.0f.
That error exists for me when creating the project in Windows, and then opening the project in Mac OS X. Currently using Unity version 2020.1.3f1
Is there a way to alter the condition so that this error doesn't show up? That is, something like UNITY_2018_2_OR_NEWER and UNITY_LESS_THAN_2020?
I had this issue after cloning my GitHub repo, the solution for me was to import the GitHub files from the asset store after the clone.