- Home /
Question by
llamagod · Jan 20, 2021 at 12:57 PM ·
textureassetdatabasetextureimporterisreadable
Set TextureImporter.isReadable to true in script
If you call AssetDatabase.ImportAsset with textureImporter.isReadable = true, then it won't work. The asset is not imported and nothing happens. No errors.
Why is this? How can you set isReadable = true for a texture from an editor script?
string path = AssetDatabase.GetAssetPath(texture);
TextureImporter textureImporter = AssetImporter.GetAtPath(path) as TextureImporter;
textureImporter.isReadable = true;
AssetDatabase.ImportAsset(path, ImportAssetOptions.ForceUpdate);
Comment
Your answer
Follow this Question
Related Questions
"Too many files open" while working with textures 0 Answers
Differentiating between first import and reimport in the TextureImporter 0 Answers
Setting isReadable for a procedurally created texture asset 1 Answer
Override texture import path 0 Answers
How tp create a material from a dds texture from within an editor script 0 Answers