private void loadPreset( string presetName )
 	{
 		string prefix = "ModelImportManager." + presetName;
  
 		// Meshes
 		mGlobalScale = EditorPrefs.GetFloat( prefix + ".GlobalScale", 1.0f );
 		mMeshCompression = (ModelImporterMeshCompression)System.Enum.Parse( typeof(ModelImporterMeshCompression),
 								EditorPrefs.GetString( prefix + ".MeshCompression", "Off" ) );
 		mOptimizeMesh = EditorPrefs.GetBool( prefix + ".OptimizeMesh", false );
 		mAddCollider = EditorPrefs.GetBool( prefix + ".AddCollider", false );
 		mSwapUVChannels = EditorPrefs.GetBool( prefix + ".SwapUVChannels", false );
 		mGenerateSecondaryUV = EditorPrefs.GetBool( prefix + ".GenerateSecondaryUV", false );
  
 		// Normals & Tangents
 		mNormalImportMode = (ModelImporterTangentSpaceMode)System.Enum.Parse( typeof(ModelImporterTangentSpaceMode),
 								EditorPrefs.GetString( prefix + ".NormalImportMode", "Import" ) );
 		mTangentImportMode = (ModelImporterTangentSpaceMode)System.Enum.Parse( typeof(ModelImporterTangentSpaceMode),
 								EditorPrefs.GetString( prefix + ".TangentImportMode", "Calculate" ) );
 		mNormalSmoothingAngle = EditorPrefs.GetFloat( prefix + ".NormalSmoothingAngle", 60.0f );
 		mSplitTangentsAcrossSeams = EditorPrefs.GetBool( prefix + ".SplitTangentsAcrossSeams", false );
  
 		// Materials
 		mImportMaterials = EditorPrefs.GetBool( prefix + ".ImportMaterials", false );
 		mMaterialName = (ModelImporterMaterialName)System.Enum.Parse( typeof(ModelImporterMaterialName),
 								EditorPrefs.GetString( prefix + ".MaterialName", "BasedOnTextureName" ) );
 		mMaterialSearch = (ModelImporterMaterialSearch)System.Enum.Parse( typeof(ModelImporterMaterialSearch),
 								EditorPrefs.GetString( prefix + ".MaterialSearch", "RecursiveUp" ) );
  
 		// remember current preset selection
 		mCurrentPresetName = presetName;
 		EditorPrefs.SetString( "ModelImportManager.CurrentPreset", mCurrentPresetName );
 	}
 	private void reset()
 	{
 		// Meshes
 		mGlobalScale = 1.0f;
 		mMeshCompression = ModelImporterMeshCompression.Off;
 		mOptimizeMesh = false;
 		mAddCollider = false;
 		mSwapUVChannels = false;
 		mGenerateSecondaryUV = false;
  
 		// Normals & Tangents
 		mNormalImportMode = ModelImporterTangentSpaceMode.Import;
 		mTangentImportMode = ModelImporterTangentSpaceMode.Calculate;
 		mNormalSmoothingAngle = 60.0f;
 		mSplitTangentsAcrossSeams = false;
  
 		// Materials
 		mImportMaterials = true;
 		mMaterialName = ModelImporterMaterialName.BasedOnTextureName;
 		mMaterialSearch = ModelImporterMaterialSearch.RecursiveUp;
  
  
 		// remember current preset selection
 		mCurrentPresetName = mDefaultPresetName;
 		EditorPrefs.SetString( "ModelImportManager.CurrentPreset", mCurrentPresetName );
 	}
Exemplo n.º 3
0
 private void DisplayMaterialSettings()
 {
     GUILayout.Label("Material Settings", EditorStyles.miniBoldLabel);
     importMaterials  = EditorGUILayout.Toggle("Import Materials", importMaterials);
     materialNameMode = (ModelImporterMaterialName)EditorGUILayout.EnumPopup("Material Naming", materialNameMode);
     materialSearch   = (ModelImporterMaterialSearch)EditorGUILayout.EnumPopup("Material Search", materialSearch);
 }
Exemplo n.º 4
0
        public override void ApplyDefaults()
        {
            this.RuleName = "New Model Rule";
            SuffixFilter  = ".FBX";

            meshCompression     = ModelImporterMeshCompression.Off;
            isReadable          = false;
            importBlendShapes   = false;
            optimizeMeshForGPU  = true;
            generateColliders   = false;
            keepQuads           = false;
            weldVertices        = true;
            swapUVChannels      = false;
            generateSecondaryUV = false;
            normalImportMode    = ModelImporterNormals.None;
            tangentImportMode   = ModelImporterTangents.CalculateMikk;
            importMaterials     = true;
            materialName        = ModelImporterMaterialName.BasedOnTextureName;
            materialSearch      = ModelImporterMaterialSearch.Everywhere;

            animationType = ModelImporterAnimationType.None;

            importAnimation = false;
            animCompression = ModelImporterAnimationCompression.Off;
        }
Exemplo n.º 5
0
    public void RemapAssetMaterials(List <Object> subAsset, ModelImporterMaterialSearch searchType)
    {
        // Validate that there is at least 1 Object
        if (subAsset.Count > 0)
        {
            // Foreach Object in the selected menu
            foreach (Object path in subAsset)
            {
                if (path != null)
                {
                    // Load the asset
                    string        assetPath     = AssetDatabase.GetAssetPath(path);
                    var           assetImporter = AssetImporter.GetAtPath(assetPath);
                    ModelImporter modelImporter = assetImporter as ModelImporter;

                    // Search for the materials and remap them accordingly
                    modelImporter.materialLocation = ModelImporterMaterialLocation.InPrefab;
                    modelImporter.SearchAndRemapMaterials(ModelImporterMaterialName.BasedOnMaterialName, searchType);

                    assetImporter.SaveAndReimport();
                }
            }
        }
        else
        {
            Debug.Log("Error, the number of models must be greater than one.");
        }
    }
Exemplo n.º 6
0
        private void InitModel()
        {
            m_globalScale       = 1f;
            m_meshCompression   = ModelImporterMeshCompression.Off;
            m_isReadable        = true;
            m_optimizeMesh      = true;
            m_importBlendShapes = true;
            m_addCollider       = false;
            m_swapUVChannels    = false;
            m_importNormals     = ModelImporterNormals.Import;
            m_importTangents    = ModelImporterTangents.CalculateMikk;

            m_importMaterials = true;
            m_materialName    = ModelImporterMaterialName.BasedOnTextureName;
            m_materialSearch  = ModelImporterMaterialSearch.RecursiveUp;
        }
Exemplo n.º 7
0
        private void DrawMaterialsGUI()
        {
            importMaterials = EditorGUILayout.Toggle(AssetImportStyles.Model.ImportMaterials, importMaterials);
            string tip;

            if (importMaterials)
            {
                materialName   = (ModelImporterMaterialName)EditorGUILayout.Popup(AssetImportStyles.Model.MaterialName, (int)materialName, AssetImportStyles.Model.MaterialNameOptMain);
                materialSearch = (ModelImporterMaterialSearch)EditorGUILayout.Popup(AssetImportStyles.Model.MaterialSearch, (int)materialSearch, AssetImportStyles.Model.MaterialSearchOpt);
                tip            = string.Concat(AssetImportStyles.Model.MaterialHelpStart.text.Replace("%MAT%", AssetImportStyles.Model.MaterialNameHelp[(int)materialName].text), "\n", AssetImportStyles.Model.MaterialSearchHelp[(int)materialSearch].text, "\n", AssetImportStyles.Model.MaterialHelpEnd.text);
            }
            else
            {
                tip = AssetImportStyles.Model.MaterialHelpDefault.text;
            }
            GUILayout.Label(new GUIContent(tip), EditorStyles.helpBox, new GUILayoutOption[0]);
        }
    public void ApplyDefaults()
    {
        m_MeshCompression   = ModelImporterMeshCompression.Off;
        m_IsReadable        = false;
        m_ImportBlendShapes = false;
        m_AddColliders      = false;
        keepQuads           = false;
        m_weldVertices      = true;
        swapUVChannels      = false;
        generateSecondaryUV = false;
        normalImportMode    = ModelImporterNormals.None;
        tangentImportMode   = ModelImporterTangents.None;
        m_ImportMaterials   = true;
        m_MaterialName      = ModelImporterMaterialName.BasedOnMaterialName;
        m_MaterialSearch    = ModelImporterMaterialSearch.Everywhere;

        AnimationType = ModelImporterAnimationType.None;

        ImportAnimation = false;
    }
Exemplo n.º 9
0
        private void DrawModel()
        {
            EditorGUILayout.BeginVertical();

            EditorGUILayout.LabelField("Meshes", EditorStyles.boldLabel);
            GUI.color = Color.grey;
            EditorGUILayout.LabelField("File Scale");
            GUI.color           = Color.white;
            m_globalScale       = EditorGUILayout.FloatField("Scale Factor", m_globalScale);
            m_meshCompression   = (ModelImporterMeshCompression)EditorGUILayout.EnumPopup("Mesh Compression", m_meshCompression);
            m_isReadable        = EditorGUILayout.Toggle("Read/Write Enabled", m_isReadable);
            m_optimizeMesh      = EditorGUILayout.Toggle("Optimize Mesh", m_optimizeMesh);
            m_importBlendShapes = EditorGUILayout.Toggle("Import BlendShapes", m_importBlendShapes);
            m_addCollider       = EditorGUILayout.Toggle("Generate Colliders", m_addCollider);
            GUI.color           = Color.grey;
            EditorGUILayout.LabelField("Keep Quads");
            GUI.color        = Color.white;
            m_swapUVChannels = EditorGUILayout.Toggle("Swap UVs", m_swapUVChannels);
            GUI.color        = Color.grey;
            EditorGUILayout.LabelField("Generate Lightmap UVs");
            GUI.color = Color.white;

            EditorGUILayout.LabelField("Normals & Tangents", EditorStyles.boldLabel);
            m_importNormals = (ModelImporterNormals)EditorGUILayout.EnumPopup("Normals", m_importNormals);
            GUI.color       = Color.grey;
            EditorGUILayout.LabelField("Smoothing Angle");
            GUI.color        = Color.white;
            m_importTangents = (ModelImporterTangents)EditorGUILayout.EnumPopup("Tangents", m_importTangents);

            EditorGUILayout.LabelField("Materials", EditorStyles.boldLabel);
            m_importMaterials = EditorGUILayout.Toggle("Import Materials", m_importMaterials);
            if (m_importMaterials == true)
            {
                m_materialName   = (ModelImporterMaterialName)EditorGUILayout.EnumPopup("Material Naming", m_materialName);
                m_materialSearch = (ModelImporterMaterialSearch)EditorGUILayout.EnumPopup("Material Search", m_materialSearch);
            }

            EditorGUILayout.EndVertical();
        }
 	private void drawSettingDialog()
 	{
 		GUILayout.BeginVertical( GUILayout.MinWidth( 300 ), GUILayout.MaxWidth( 1000 ), GUILayout.ExpandWidth( true ) );
  
 		GUILayout.Label( "Meshes", EditorStyles.boldLabel );
  
 		// Global scale factor for importing.
 		mGlobalScale = EditorGUILayout.FloatField( "Scale Factor", mGlobalScale );
  
 		// Mesh compression setting.
 		mMeshCompression = (ModelImporterMeshCompression)EditorGUILayout.EnumPopup( "Mesh Compression", mMeshCompression );
  
 		// Vertex optimization setting
 		mOptimizeMesh = EditorGUILayout.Toggle( "Optimize Mesh", mOptimizeMesh );
  
 		// Add mesh colliders to imported meshes.
 		mAddCollider = EditorGUILayout.Toggle( "Generate Colliders", mAddCollider );
  
 		// Swap primary and secondary UV channels when importing.
 		mSwapUVChannels = EditorGUILayout.Toggle( "Swap UVs", mSwapUVChannels );
  
 		// Generate secondary UV set for lightmapping.
 		mGenerateSecondaryUV = EditorGUILayout.Toggle( "Generate Lightmap UVs", mGenerateSecondaryUV );
  
  
 		EditorGUILayout.Space();
 		GUILayout.Label( "Normals & Tangents", EditorStyles.boldLabel );
  
 		// Normals import mode.
 		mNormalImportMode = (ModelImporterTangentSpaceMode)EditorGUILayout.EnumPopup( "Normals", mNormalImportMode );
  
 		// Tangents import mode.
 		mTangentImportMode = (ModelImporterTangentSpaceMode)EditorGUILayout.EnumPopup( "Tangents", mTangentImportMode );
  
 		EditorGUI.BeginDisabledGroup( mNormalImportMode != ModelImporterTangentSpaceMode.Calculate );
  
 		// Smoothing angle for calculating normals.
 		mNormalSmoothingAngle = (int)EditorGUILayout.IntSlider( "Smoothing Angle", (int)mNormalSmoothingAngle, 0, 180 );
  
 		EditorGUI.EndDisabledGroup();
  
 		// Should tangents be split across UV seams.
 		mSplitTangentsAcrossSeams = EditorGUILayout.Toggle( "Split Tangents", mSplitTangentsAcrossSeams );
  
  
 		EditorGUILayout.Space();
 		GUILayout.Label( "Materials", EditorStyles.boldLabel );
  
 		// Import materials from file.
 		mImportMaterials = EditorGUILayout.Toggle( "Import Materials", mImportMaterials );
  
 		EditorGUI.BeginDisabledGroup( !mImportMaterials );
  
 		// Material naming setting.
 		mMaterialName = (ModelImporterMaterialName)EditorGUILayout.EnumPopup( "Material Naming", mMaterialName );
  
 		// Existing material search setting.
 		mMaterialSearch = (ModelImporterMaterialSearch)EditorGUILayout.EnumPopup( "Material Search", mMaterialSearch );
  
 		EditorGUI.EndDisabledGroup();
  
 		EditorGUILayout.Space();
 		EditorGUILayout.BeginHorizontal();
 		if( mCurrentPresetName != mDefaultPresetName )
 		{
 			if( GUILayout.Button( "Save" ) )
 				savePreset( mCurrentPresetName );
  
 			if( GUILayout.Button( "Delete" ) )
 				deletePreset( mCurrentPresetName );
 		}
 		else
 		{
 			if( GUILayout.Button( "Save As", GUILayout.Width( 200 ) ) && ( mNewPresetName.Length > 0 ) && ( mNewPresetName != mDefaultPresetName ) )
 			{
 				savePreset( mNewPresetName );
 				loadPreset( mNewPresetName );
 			}
  
 			// only characters allowed
 			mNewPresetName = Regex.Replace( GUILayout.TextField( mNewPresetName ), @"[^\w]", string.Empty );
 		}
 		EditorGUILayout.EndHorizontal();
  
 		GUILayout.EndVertical();
 	}
 public extern bool SearchAndRemapMaterials(ModelImporterMaterialName nameOption, ModelImporterMaterialSearch searchOption);
Exemplo n.º 12
0
        public override void DrawInnerGUI()
        {
            DrawFilterGUI();

            EditorGUILayout.LabelField("Meshes", EditorStyles.boldLabel);
            EditorGUI.DrawRect(EditorGUILayout.GetControlRect(false, 2), QuickEditorColors.DarkGrayX11);
            GUILayout.Space(3);

            ScaleFactor        = EditorGUILayout.FloatField("Scale Factor", ScaleFactor);
            MeshCompression    = (ModelImporterMeshCompression)EditorGUILayout.EnumPopup("Mesh Compression", MeshCompression);
            ReadWriteEnabled   = EditorGUILayout.Toggle("Read/Write Enabled", ReadWriteEnabled);
            OptimizeMesh       = EditorGUILayout.Toggle("Optimize Mesh", OptimizeMesh);
            ImportBlendShapes  = EditorGUILayout.Toggle("Import BlendShapes", ImportBlendShapes);
            GenerateColliders  = EditorGUILayout.Toggle("Generate Colliders", GenerateColliders);
            KeepQuads          = EditorGUILayout.Toggle("Keep Quads", KeepQuads);
            WeldVertices       = EditorGUILayout.Toggle("Weld Vertices", WeldVertices);
            ImportVisibility   = EditorGUILayout.Toggle("Import Visibility", ImportVisibility);
            ImportCameras      = EditorGUILayout.Toggle("Import Cameras", ImportCameras);
            ImportLights       = EditorGUILayout.Toggle("Import Lights", ImportLights);
            SwapUVs            = EditorGUILayout.Toggle("Swap UVs", SwapUVs);
            GenerateLightmapUV = EditorGUILayout.Toggle("Generate Lightmap UVs", GenerateLightmapUV);

            if (GenerateLightmapUV)
            {
                EditorGUI.indentLevel++;
                LightmapHardAngle  = EditorGUILayout.IntSlider("Hard Angle", LightmapHardAngle, 0, 180);
                LightmapPadding    = EditorGUILayout.IntSlider("Pack Margin", LightmapPadding, 1, 64);
                LightmapAngleError = EditorGUILayout.IntSlider("Angle Error", LightmapAngleError, 1, 75);
                LightmapAreaError  = EditorGUILayout.IntSlider("Area Error", LightmapAreaError, 1, 75);
                EditorGUI.indentLevel--;
            }

            GUILayout.Space(6);
            EditorGUILayout.LabelField("Normals & Tangent", EditorStyles.boldLabel);
            EditorGUI.DrawRect(EditorGUILayout.GetControlRect(false, 2), QuickEditorColors.DarkGrayX11);
            GUILayout.Space(3);

            ImportNormals = (ModelImporterNormals)EditorGUILayout.EnumPopup("Normals", ImportNormals);
            EditorGUI.BeginDisabledGroup(ImportNormals == ModelImporterNormals.Calculate ? false : true);
            //NormalCalculationMode = (ModelImporterNormalCalculationMode)EditorGUILayout.EnumPopup("Normals Mode", NormalCalculationMode);
            SmoothingAngle = EditorGUILayout.IntSlider("Smoothing Angle", SmoothingAngle, 0, 180);
            EditorGUI.EndDisabledGroup();
            EditorGUI.BeginDisabledGroup(ImportNormals == ModelImporterNormals.None ? true : false);
            TangentMode = (ModelImporterTangents)EditorGUILayout.EnumPopup("Tangents", TangentMode);
            EditorGUI.EndDisabledGroup();

            GUILayout.Space(6);
            EditorGUILayout.LabelField("Materials", EditorStyles.boldLabel);
            EditorGUI.DrawRect(EditorGUILayout.GetControlRect(false, 2), QuickEditorColors.DarkGrayX11);
            GUILayout.Space(3);

            ImportMats = EditorGUILayout.Toggle("Import Materials", ImportMats);
            if (ImportMats)
            {
                MaterialNaming = (ModelImporterMaterialName)EditorGUILayout.EnumPopup("Material Naming", MaterialNaming);
                MaterialSearch = (ModelImporterMaterialSearch)EditorGUILayout.EnumPopup("Material Search", MaterialSearch);
            }

            GUILayout.Space(6);
            EditorGUILayout.LabelField("Animation", EditorStyles.boldLabel);
            EditorGUI.DrawRect(EditorGUILayout.GetControlRect(false, 2), QuickEditorColors.DarkGrayX11);
            GUILayout.Space(3);

            ImportAnim = EditorGUILayout.Toggle("Import Animation", ImportAnim);
            ForceNoRig = EditorGUILayout.Toggle("Force no rig", ForceNoRig);

            GUILayout.Space(8);
        }
Exemplo n.º 13
0
    void OnGUI()
    {
        EventType e = Event.current.type;

        GUILayout.BeginHorizontal();
        if (GUILayout.Button("+ (Add)"))
        {
            characters.Add(null);
        }
        if (GUILayout.Button("- (Remove)"))
        {
            characters.RemoveAt(characters.Count - 1);
        }
        GUILayout.EndHorizontal();

        if (logo == null)
        {
            logo = (Texture2D)Resources.Load("MaterialMapper", typeof(Texture2D));
        }

        #region Logo
        // Editor Icon
        GUILayout.BeginHorizontal();
        GUILayout.FlexibleSpace();
        GUILayout.Label(logo, GUILayout.MaxHeight(135), GUILayout.Width(position.width));
        GUILayout.FlexibleSpace();
        GUILayout.EndHorizontal();
        #endregion

        // List Logic
        if (characters.Count > 0)
        {
            GUILayout.BeginVertical(EditorStyles.helpBox);

            for (int i = 0; i < characters.Count; i++)
            {
                characters[i] = EditorGUILayout.ObjectField(characters[i], typeof(Object), true) as Object;
            }
            GUILayout.EndVertical();
        }

        EditorGUILayout.Space();

        // Search type GUI
        searchType = (ModelImporterMaterialSearch)EditorGUILayout.EnumPopup("Search Type: ", searchType);

        EditorGUILayout.Space();

        GUILayout.BeginHorizontal();
        // Begin assinging the materials
        if (GUILayout.Button("Assign Materials"))
        {
            MatSearcher map = new MatSearcher();

            map.RemapAssetMaterials(characters, searchType);

            map = null;
        }
        // Fix The Animation names to match the file names
        if (GUILayout.Button("Fix Animation Names"))
        {
            MatSearcher map = new MatSearcher();

            map.FixAnimationsNames(characters);

            map = null;
        }
        GUILayout.EndHorizontal();

        EditorGUILayout.Space();

        if (GUILayout.Button("Clear Selection"))
        {
            if (characters.Count > 0)
            {
                characters = new List <Object>
                {
                    null
                };
            }
        }
        if (GUILayout.Button("Load Assets from Folder"))
        {
            if (characters[0] != null)
            {
                string holder  = AssetDatabase.GetAssetPath(characters[0]);
                string holder2 = holder.Substring(7, holder.Length - 7);

                int slashIndex = 0;
                int iterator   = 0;

                // Find the last Slash to remove from the search index
                while (iterator < holder2.Length)
                {
                    if (holder2[iterator] == '/')
                    {
                        slashIndex = iterator;
                    }

                    iterator++;
                }

                string holder3 = holder2.Substring(0, slashIndex + 1);


                Object[] temp = GetAtPath <Object>(holder3);

                if (temp.Length > 0)
                {
                    characters.Clear();
                    characters = temp.OfType <Object>().ToList();
                }
            }
        }
    }
Exemplo n.º 14
0
        /// <inherit/>
        public override void OnGUI()
        {
            // meshes
            EditorGUILayout.LabelField("Meshes", EditorStyles.boldLabel);
            scaleFactor = EditorGUILayout.FloatField("Scale Factor", scaleFactor);
            meshCompression = (ModelImporterMeshCompression)EditorGUILayout.EnumPopup("Mesh Compression", meshCompression);
            readWriteEnabled = EditorGUILayout.Toggle("Read/Write Enabled", readWriteEnabled);
            optimizeMesh = EditorGUILayout.Toggle("Optimize Mesh", optimizeMesh);
            importBlendShapes = EditorGUILayout.Toggle("Import BlendShapes", importBlendShapes);
            generateColliders = EditorGUILayout.Toggle("Generate Colliders", generateColliders);
            swapUVs = EditorGUILayout.Toggle("Swap UVs", swapUVs);
            generateLightmapUV = EditorGUILayout.Toggle("Generate Lightmap UVs", generateLightmapUV);

            // normals and tangents
            EditorGUILayout.LabelField("Normals & Tangents", EditorStyles.boldLabel);
            normals = (ModelImporterTangentSpaceMode)EditorGUILayout.EnumPopup("Normals", normals);
            tangents = (ModelImporterTangentSpaceMode)EditorGUILayout.EnumPopup("Tangents", tangents);
            GUI.enabled = normals == ModelImporterTangentSpaceMode.Calculate;
            smoothingAngle = EditorGUILayout.Slider("Smoothing Angle", smoothingAngle, SmoothingAngleMin, SmoothingAngleMax);
            GUI.enabled = true;
            GUI.enabled = tangents == ModelImporterTangentSpaceMode.None;
            splitTangents = EditorGUILayout.Toggle("Split Tangents", splitTangents);
            GUI.enabled = true;

            // materials
            EditorGUILayout.LabelField("Materials", EditorStyles.boldLabel);
            importMaterials = EditorGUILayout.Toggle("Import Materials", importMaterials);

            if (importMaterials)
            {
                materialNaming = (ModelImporterMaterialName)EditorGUILayout.EnumPopup("Material Naming", materialNaming);
                materialSearch = (ModelImporterMaterialSearch)EditorGUILayout.EnumPopup("Material Search", materialSearch);
            }
        }
Exemplo n.º 15
0
        void OnDrawOptionUI()
        {
            EditorGUILayout.LabelField("Meshes", EditorStyles.boldLabel);
            _scaleFactor         = EditorGUILayout.FloatField("Scale Factor", _scaleFactor);
            _bUseFileScale       = EditorGUILayout.Toggle("Use File Scale", _bUseFileScale);
            GUI.enabled          = _bUseFileScale;
            _fileScale           = EditorGUILayout.FloatField("   File Scale", _fileScale);
            GUI.enabled          = true;
            _eMeshCompression    = (ModelImporterMeshCompression)EditorGUILayout.EnumPopup("Mesh Compression", _eMeshCompression);
            _ReadWriteEnable     = EditorGUILayout.Toggle("Read/Write Enabled", _ReadWriteEnable);
            _OptimizeMesh        = EditorGUILayout.Toggle("Optimize Mesh", _OptimizeMesh);
            _ImportBlendShapes   = EditorGUILayout.Toggle("Import BlendShapes", _ImportBlendShapes);
            _GenerateColliders   = EditorGUILayout.Toggle("Generate Colliders", _GenerateColliders);
            _KeepQuads           = EditorGUILayout.Toggle("Keep Quads", _KeepQuads);
            _bWeldVertices       = EditorGUILayout.Toggle("Weld Vertices", _bWeldVertices);
            _bImportVisibility   = EditorGUILayout.Toggle("Import Visibility", _bImportVisibility);
            _bImportCameras      = EditorGUILayout.Toggle("Import Cameras", _bImportCameras);
            _bImportLights       = EditorGUILayout.Toggle("Import Lights", _bImportLights);
            _SwapUVs             = EditorGUILayout.Toggle("Swap UVs", _SwapUVs);
            _GenerateLightmapUVs = EditorGUILayout.Toggle("Generate Lightmap UVs", _GenerateLightmapUVs);
            if (_GenerateLightmapUVs)
            {
                _uiFolderAdvanced = EditorGUILayout.Foldout(_uiFolderAdvanced, "Advanced");
                if (_uiFolderAdvanced)
                {
                    _HardAngle  = EditorGUILayout.IntSlider("   Hard Angle", _HardAngle, 0, 180);
                    _PackMargin = EditorGUILayout.IntSlider("   Pack Margin", _PackMargin, 0, 180);
                    _AngleError = EditorGUILayout.IntSlider("   Angle Error", _AngleError, 0, 180);
                    _AreaError  = EditorGUILayout.IntSlider("   Area Error", _AreaError, 0, 180);
                }
            }


            EditorGUILayout.LabelField("Normals & Tangents", EditorStyles.boldLabel);
            _eImporterNormals = (ModelImporterNormals)EditorGUILayout.EnumPopup("Normals", _eImporterNormals);

            GUI.enabled        = _eImporterNormals == ModelImporterNormals.Calculate;
            _SmoothAngle       = EditorGUILayout.IntSlider("Smooth Angles", _SmoothAngle, 0, 180);
            GUI.enabled        = _eImporterNormals != ModelImporterNormals.None;
            _eImporterTangents = (ModelImporterTangents)EditorGUILayout.EnumPopup("Tangents", _eImporterTangents);
            GUI.enabled        = true;

            EditorGUILayout.LabelField("Materials", EditorStyles.boldLabel);
            _ImportMaterials = EditorGUILayout.Toggle("ImportMaterials", _ImportMaterials);
            if (_ImportMaterials)
            {
                _eImporterMaterialName   = (ModelImporterMaterialName)EditorGUILayout.Popup("Material Naming", (int)_eImporterMaterialName, _strMaterialNaming);
                _eImporterMaterialSearch = (ModelImporterMaterialSearch)EditorGUILayout.EnumPopup("Material Search", _eImporterMaterialSearch);
            }

            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Find"))
            {
                FindModelImport();
            }

            if (GUILayout.Button("Apply"))
            {
                ApplyModelImport();
            }
            GUILayout.EndHorizontal();
        }