How do I instantiate and invoke a custom AssetImporter on a particular type of asset?

Title of post says it all. How do I instantiate and invoke a custom AssetImporter on a particular type of asset? Looks like I am missing one essential piece of information of how to do this.

Things I have looked at and considered: Unity Answers, Unity Forums, Unity Wiki, anything and everything in Google that references AssetImporter and AssetPostProcessor. I have even taken apart the UnityEditor.dll and UnityEngine.dll to see how the TextureImporter and Texture (asset class) work using Redgate Reflector, and disassembled large chunks of the importer functions in Unity.exe using IDA. I can see clearly that UT is using reflection to invoke AssetPostProcessors, but then the investigative path goes cold.

Any information gratefully received at this point. Especially from someone who has actually written a custom AssetImporter.

Yes yes. Your title says all but i still need more details instead of you telling us how you have tried.

But invoking what do you mean? Invoke a function when you instantiate that object?

I have an asset of a particular type not handled by the standard asset importers that ship with Unity. I need to instantiate and then invoke an AssetImporter on that particular asset. I assume that the invocation happens automagically in the background through reflection from Unity’s internal asset importing functionality as found in Unity.exe and UnityEditor.DLL much like the instantiation of AssetPostProcessors.

Once the AssetPostProcessor indicates that the asset is of a particular type and should be imported, something “magical” happens that I have yet to determine. This is the piece of information I am missing, how do I connect my AssetPostProcessor validation of the asset to the requisite AssetImporter. There is no way to register an AssetImporter of handling a particular type (back-traced and disassembled the TextureImporter in Unity to see where that lead but either overlooked the obvious (most likely) or looked in the wrong place for the instantiation and invocation.

When I first started on this quest, I assumed assetPath would be the obvious candidate for setting up AssetImporters, but it is read-only.

I could instantiate the AssetImporter inside of my AssetPostProcessor (AssetPostProcessor.OnPostprocessAllAssets seems counter-intuitive to be instantiating AssetImporters after everything is imported) but then where do I store that AssetImporter? What messages should I send it? What methods should I invoke?

Hmm, two thoughts strike me. Rhetorical questions.

Is there a mechanism that would allow me to dispatch a message of the appropriate type that will instantiate the AssetImporter through reflection in the internal asset processor? (Will need to take a look at the Unity internal asset processor code again).

Should I instantiate the AssetImporter and then add it as an object to the asset? Should AssetImporters be attached to Assets? <— strong signs point to “yes” as AssetImporters can have AssetImportInspectors which is the Editor GUI component of the AssetImporter.

Time for more investigation.

Very good question.
Something new since then ?