21/09/10 TextureImporter and cubemap
https://docs.unity3d.com/ScriptReference/TextureImporter.html
Unity - Scripting API: TextureImporter
Success! Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable. Close
docs.unity3d.com
https://forum.unity.com/threads/change-the-texture-shape-via-script.471261/
Change the texture shape via script ?
Hey there ! I'm making an Editor script in order to tranfsorm my textures into Cubemap materials, I'm ok with it excepted for the texture shape that...
forum.unity.com
```
- // Getting textures
- var textures = Selection.GetFiltered(typeof(Texture), SelectionMode.Assets).Cast<Texture>();
- foreach (var tex in textures)
- {
- // Texture path
- string path = AssetDatabase.GetAssetPath(tex);
- // If the texture dimensions is not "Cube", we convert it
- TextureImporter importer = (TextureImporter)TextureImporter.GetAtPath(path);
- if (tex.dimension != UnityEngine.Rendering.TextureDimension.Cube)
- {
- importer.textureShape = TextureImporterShape.TextureCube;
- importer.SaveAndReimport();
- }
- }
```
https://docs.unity3d.com/Manual/class-Cubemap.html
Unity - Manual: Cubemaps
Cubemaps Switch to Scripting A Cubemap is a collection of six square textures that represent the reflections on an environment. The six squares form the faces of an imaginary cube that surrounds an object; each face represents the view along the directions
docs.unity3d.com
https://docs.unity3d.com/ScriptReference/Cubemap.html
Unity - Scripting API: Cubemap
Success! Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable. Close
docs.unity3d.com