OnPostprocessMaterial never called.

I am trying to get a callback when a material is changed (specifically when the _MainTex-reference is changed), but the OnPostprocessMaterial() function is never getting called.

public class MyAssetPostprocessor : UnityEditor.AssetPostprocessor {
void OnPostprocessMaterial(Material material) {
Debug.Log ("Postprocessing material: " + (material ? material.name : “null”));
}
}

Having this problem in 2017.1.0p4 and 2017.3.1f1. What’s wrong?

For 2017.1 the functionality doesn’t exist:

For 2017.3 it should work (at least from the documentation and your code has no typos). Maybe it is a bug, since it is the version unity version that supports it?

Neither making changes to a material nor importing it via drag and drop or even explicitly through Context Menu → Import New Asset appears to call the function. Implementation of the constructor reveals that it is getting called at least when creating or importing materials though.

Even if it worked I guess this is only intended for import post processing, not for reacting to changes.

The last line at document: This method is only called by the ModelImporter.