- Home /
Model Importer fbm folder is still created
Hi, I dont want Unity to import the materials from fbx models, so I created an input override class:
using UnityEditor;
public class ModelImportOverride : AssetPostprocessor
{
void OnPreprocessModel()
{
ModelImporter importer = assetImporter as ModelImporter;
string name = importer.assetPath.ToLower();
if (name.Substring(name.Length - 4, 4) == ".fbx")
{
importer.importMaterials = false;
importer.globalScale = 1;
importer.animationType = ModelImporterAnimationType.Legacy;
}
}
}
The materials arent imported, but the fbm folder is still created (empty). How can I fix this? I already tried this:
void OnPostProcessModel()
{
ModelImporter importer = assetImporter as ModelImporter;
Directory.Delete(importer.assetPath.Substring(0, importer.assetPath.Length - 4) + ".fbm");
}
but that didnt work either.
Answer by Nikodem · Dec 03, 2015 at 01:53 PM
It is possible that you still have the meta file of the folder so Unity recreates it every time it gets removed.
After only couple of hours researching, here's a working solution! Thanks.
Your answer
Follow this Question
Related Questions
Editor class "Texture Importer" question (applying settings to multiple texture assets). 2 Answers
Set Import Setting When an Audio Clip is Dragged into the Project 0 Answers
Creating a prefab in AssetPostprocessor.OnPostprocessAllAssets(). 1 Answer
Reimport a specific folder? 6 Answers
How do I programmatically assign a GameObject to a prefab? 6 Answers