Independent Texture Tiling Conversion Script

What is this change?

In Lumberyard Beta 1.8 a new feature called Independent Texture Tiling was introduced that may require the use of a script to convert certain material assets (*.mtl) to properly support this new feature.

Do I need to run the script?

If you have authored any material assets that have modified the Tiling, Rotation or Oscillation values within the main Diffuse Map then you will need to run the script. If you have never made changes to a material’s Diffuse Map’s Tiling, Rotation or Oscillation, than you do not need to run the script. Because the script will only convert materials that actually need it, it’s better to err on the side of caution and run the script anyways.

How do I run this script?

  1. Download the script from here.
  2. Save the 1.8_IndependentTilingConvertor.py file into **\dev\Editor\Scripts\migration\1.8**, creating the folder if need be.

Running from the command prompt:

    1. Open a command prompt and navigate to your build’s python folder: <ly_install>******\dev\Tools\Python\2.7.11\windows
  1. Type in and press enter: python <ly_install>\dev\Editor\Scripts\migration\1.8\1.8_IndependentTilingConvertor.py
  2. Optionally, if you want to run the script on a single project instead of every project in your build, type in and press enter: python <ly_install>\dev\Editor\Scripts\migration\1.8\1.8_IndependentTilingConvertor.py “my_project”
  3. You can run the script on multiple projects at once by using commas to seperate project names: python <ly_install>\dev\Editor\Scripts\migration\1.8\1.8_IndependentTilingConvertor.py “my_project,my_other_project”

Running from inside of Lumberyard:

  1. Open the Python Scripts tool: Tools → Other → Python Scripts
  2. Locate the 1.8_IndependentTilingConvertor.py script and highlight it.
  3. Click on the Execute button in the lower right of the Python Scripts window.
    As the script runs, it will validate each material to determine if it needs to be converted. If so, it will convert the material and make note of the material’s filename in a log file (log_filename.log). This log file will prevent the material from being converted again if the script is ever run a second time. This script should only ever have to be run once per project. Running the script without the optional project name (Step #4) will convert all materials in all projects within your Lumberyard build.

Why do I need to run this?

In Lumberyard 1.8, the Independent Texture Tiling feature allows the Second Diffuse Map, Emittance Map or Detail Maps to have their own independent UV modulator for any Tiling, Rotation or Oscillation values applied to them. Before 1.8, those values were ignored and a material used the values applied in the main Diffuse Map. This script will copy over values from the main Diffuse Map into the Second Diffuse, Emittance and Detail Maps ensuring those map’s texture modulators look and operate the same way they did in Lumberyard 1.7 or earlier. Going forward, any changes made to the Tiling, Rotation or Oscillation values in those modulators will be properly saved into the material file and operate independent of the values saved in the main Diffuse Map.