# OnPreprocessAsset()

> Add this function to a subclass to get a notification just before any Asset is imported.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor](/engine/6000.5/script-reference/unityeditor.md)

```csharp
public void OnPreprocessAsset()
```

### Remarks

This lets you control the import settings through code.

### Examples

```csharp

using UnityEditor;

class MyModelPostprocessor : AssetPostprocessor
{
    // Increment the version number, when the AssetPostprocessors code/behavior is changed
    static readonly uint k_Version = 0;
    public override uint GetVersion() { return k_Version; }

    void OnPreprocessAsset()
    {
        if (assetImporter.importSettingsMissing)
        {
            ModelImporter modelImporter = assetImporter as ModelImporter;
            if (modelImporter != null)
            {
                if (!assetPath.Contains("@"))
                    modelImporter.importAnimation = false;
                modelImporter.materialImportMode = ModelImporterMaterialImportMode.None;
            }
        }
    }
}
```
