- Home /
Mass Assigning Textures to Materials
Is there a way to mass assign textures to materials that share the same name with the texture? I have over 100 textures and i cant assign them to the .fbx but the materials seem to share the name... any ideas?
Answer by Bunny83 · Jan 10, 2013 at 10:02 PM
If the models should use the same material / Texture you just have to place them along with the models or in a higher folder called "Textures". You need to reimport the models so Unity should search for the right material / Texture. See this page and scroll down to "Textures"
Hmm. I have similar issue. What if I have created the meshes in a separate program from the textures and need to mass assign corresponding textures to meshes?
I have a gameobject with 96 meshes and a folder labeled "Textures" with 96 textures inside. I want Unity to read them as a package and assign textures to the materials it is creating for each mesh.
Advantage: The meshes and textures are numerically labeled to correspond to each other.
Dis-advantage: There are not pre-assigned texture/material/mesh relationships co$$anonymous$$g into Unity, such as in an fbx. Is there a way to generate this mass automatic assignment if my lists are in the same order?
I have thousands of meshes/material/texture to process so I need an automatic process.
@ristophonics: Well, if there is no premade relation between the textures and the corresponding submesh how should Unity automatically assign the textures?
However you can implement an AssetPostProcessor and code your own post processing steps. So if you have any hints in the assetnames on which you can decide which texture should be used by which material and which material belongs to which model you can do that in the appropriate callback of the post processor.
$$anonymous$$eep in $$anonymous$$d that an AssetPostProcessod will be used for all assets that are imported / reimported.
Bunny83 Thank you!
I was hoping for a mass drag & drop solution, like dragging all the textures onto the gameobject with the child meshes. The meshes and textures are equal in number and share the same organizational structure so I was hoping Unity would recognize this (if they were in some special folder structure) and apply texture00 to mesh00, texture01 to mesh01, and so forth.
I did not know about the AssetPostProcessor so I will check that out now. Thanks for the direction Bunny83! I will post anything I find for those following this.
Anymore thoughts, pipelines or work-through(s) appreciated!!!
Your answer
![](https://koobas.hobune.stream/wayback/20220613090736im_/https://answers.unity.com/themes/thub/images/avi.jpg)