How to access empty Material slots on a ModelImporter via script?

I can access occupied slots with the AssetImporter.GetExternalObjectMap() method, however if the slots are empty, the dictionary that is returned from this method is also empty too (go figure).


Wondering if there is a way to access these empty slots via script, that are so blatantly taunting me from the editor?


Those are simply accessed with the serializedObject that is available in the importer. Just have a look at the ModelImporterMaterialEditor. This array iterates through all material slots that the imported model has.