- Home /
NullReferenceException when I click on Material tab of a selected (just imported ) model
On Unity 2018.2.15f1 (and generally this happens after 2018.2 versions) I import a model ( any model ) and when I select it to extract its material name from Materials tab I get the following error and then I cannot set the textures for its material. Any ideas ?
error : NullReferenceException: Object reference not set to an instance of an object UnityEditor.PropertyHandler.OnGUILayout (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, Boolean includeChildren, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/ScriptAttributeGUI/PropertyHandler.cs:203) UnityEditor.EditorGUILayout.PropertyField (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, Boolean includeChildren, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:8791) UnityEditor.EditorGUILayout.PropertyField (UnityEditor.SerializedProperty property, UnityEngine.GUIContent label, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:8780) UnityEditor.ModelImporterMaterialEditor.DoMaterialsGUI () (at C:/buildslave/unity/build/Editor/Mono/ImportSettings/ModelImporterMaterialEditor.cs:364) UnityEditor.ModelImporterMaterialEditor.OnInspectorGUI () (at C:/buildslave/unity/build/Editor/Mono/ImportSettings/ModelImporterMaterialEditor.cs:162) UnityEditor.AssetImporterTabbedEditor.OnInspectorGUI () (at C:/buildslave/unity/build/Editor/Mono/Inspector/TabbedEditor.cs:137) UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor[] editors, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1367) UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
Your answer
Follow this Question
Related Questions
Model material remapping not working when FBX model hierarchy is changed 1 Answer
How to access empty Material slots on a ModelImporter via script? 1 Answer
Imported OBJ from an STL won't properly apply asset store materials 1 Answer
Imported textures from FBX not showing in Unity 2017 3 Answers
How can I add materials to this FBX model? I have them but no materials settings seem to work 0 Answers