- Home /
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?
Answer by Bunny83 · Mar 06, 2019 at 03:15 AM
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.
Your answer
![](https://koobas.hobune.stream/wayback/20220612193016im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
How can i create a pup-up menu like the one for choose the shader on materials in unity 2019? 1 Answer
What is the best way to draw icons in Unity's Hierarchy window? 1 Answer
Setting custom amount of space between elements in a custom inspector with EditorGUILayout ? 1 Answer
EditorGUI like light explorer window 1 Answer
Custom Editor - Is there any way to detect whether the user is in Prefab editing mode? 1 Answer