Hey folks,
I’m currently trying to import some texture assets defined in an external file, during the material creation process in the AssetImporter.
So, the mesh has an additional file with a bunch of texture paths defined in it (in a location outside of the Assets directory), and during OnAssignMaterialModel(), I pull in the file paths from the additional file and copy the texture files over into the Assets directory.
Then I try and import them (using AssetDatabase.ImportAsset(projectLocalPath) and then AssetDatabase.LoadAssetAtPath (projectLocalPath)) so I can assign them to the relevant slots in the material.
However, it doesn’t appear to be possible to import textures at that point (LoadAssetAtPath just returns null)… they don’t appear to be imported until after my mesh.
Is there a way I can import the textures then and there, and get a Texture asset back to apply to the material?