Convert legacy textured UVs to Eevee/Cycles materials (for SuperTuxKart)

As part of my efforts to port the SuperTuxKart Blender addon scripts at, I need to test out whether the scripts will export the models properly or not. Unfortunately, the text from no longer applies 100% as of Blender 2.80.

Use UV texturing in Blender for your objects for them to appear in-game, but don’t waste time with Blender materials or cycles materials. They don’t get exported into the game—instead, use SuperTuxKart’s own materials system. More information can be found on the Materials page.
In fact, don’t even bother with the Texture section of Blender’s Properties window. Simply applying a UV map is enough.

Almost the vast majority of the source flies used for STK models exclusively use UV maps and image-based texturing, often without ever touching Blender materials. However, I have learned that shader node-based materials are unfortunately required just to show image textures on models; it is considerably more complicated to texture models in 2.80+ compared to doing this in 2.79. While I can handle manually (re)setting up a few, up to about 10, of these images, it’s tiring to do this for about 100 of these on possibly hundreds of models. This script would help me if these models already used Blender materials, but it won’t work too often since these source files don’t use Blender materials at all.

There has to be some way, possibly with a script, that can help me deal with converting the legacy image-based texturing to use the shader node-based material without me having to waste time doing the conversion process completely by hand.

Here are some images to show what I"m referring to:

The kart Tux
The track Oliver’s Math Class

I eventually created a solution of my own, in the form of a custom script:
It has to be loaded in the text editor and then executed for it to be useful. It works most of the time, but there are a few limitations (most of which can be fixed after migration):

  • Vertex colors are not supported, but they are left intact
  • Decal shaders (two UV maps) are not supported
1 Like