For people who don't want to wait for a fix... as it seems like it's been months for nothing to happen when it's literally a couple of lines to fix.
You can apply a Harmony patch:
* Download Harmony (really cool tool!) -
https://harmony.pardeike.net/#documentation* Copy the following code to your Unity project and it will load automatically:
[InitializeOnLoad]
public class SubstancePatchLoader {
static SubstancePatchLoader() {
var harmony = new Harmony("SubstancePatches");
harmony.PatchAll();
Debug.Log("Loaded Substance Patches.");
}
}
[HarmonyPatch(typeof(EntryPoint), "NeedsReImport")]
class SubstanceEntryPointPatch {
static bool Prefix(ref bool __result, string pPath) {
var obj = AssetDatabase.LoadMainAssetAtPath(pPath);
if (obj is Material) {
return true;
}
__result = false;
return false;
}
}
The patch is simple - it adds a Prefix method (basically a method that gets run before the actual method gets run) and uses the path string passed into the original method and loads the Asset.
If the loaded object is a Material object, it will allow the actual method to run as normal.
If the loaded object is not a Material object, it will prevent the original method from running (the return false does this) and it will return back a false value back to the caller. (The thinking being, if it's not a Material object then it doesn't need to be reimported).
Hope it helps other people.
I also patched the Substance.MaterialEditor issue where it spews console log errors when trying to access the Material/Shader properties of code-instantiated materials (ie. not saved as an asset in the file system). If you want that one, I can also share it.