Skip to content

an unity scripts that makes materials and assigns some textures for it automatically, good for bulk producing

License

Notifications You must be signed in to change notification settings

VincentNeemie/Texture_Organizer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Objective: The objective of this script is to search for subfolders in a root folder, locate texture files within the subfolders, and use them to create materials with the correct rendering pipeline type. The newly created materials are then saved in the same subfolders as the textures.

Inputs:

  • 'rootFolderPath': a string that specifies the root folder path to start searching for subfolders.
  • 'renderingPipelineType': an enum that specifies the desired rendering pipeline type.
  • 'baseMapName': a string that specifies the name of the base map texture file.
  • 'bumpMapName': a string that specifies the name of the bump map texture file.
  • 'metallicGlossMapName': a string that specifies the name of the metallic gloss map texture file.
  • 'parallaxMapName': a string that specifies the name of the parallax map texture file.
  • 'maxSubfolders': an integer that specifies the maximum number of subfolders to process.

Flow:

  1. The script retrieves an array of all the subfolders in the root folder.
  2. The script iterates over the subfolders up to the maximum number specified.
  3. For each subfolder, the script gets an array of all the texture files in the subfolder.
  4. The script checks if all the required texture files are present.
  5. The script loads the textures into an array and assigns each texture to the correct texture property based on its name.
  6. The script creates a material with the correct rendering pipeline type.
  7. The script sets the textures on the material.
  8. The script creates a material asset and saves it in the same subfolder as the textures.

Outputs:

  • Newly created material assets: materials with the correct textures for each subfolder.

Additional aspects:

  • The script uses the 'Directory' and 'AssetDatabase' classes to locate and load asset files.
  • The script requires the texture files to have specific names as defined by the input variables.
  • The script requires the rendering pipeline type to be specified by the input variable.
  • The script logs errors and messages to the Unity console.

About

an unity scripts that makes materials and assigns some textures for it automatically, good for bulk producing

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages