Elvas Tower: Blender UV Map Names - Elvas Tower

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Blender UV Map Names Error: Missing 'UVMap' in ... Rate Topic: -----

#1 User is offline   wacampbell 

  • Member since Nov. 2003
  • Group: Fan: Traction Nuts
  • Posts: 2,346
  • Joined: 22-November 03
  • Gender:Male
  • Location:British Columbia, Canada
  • Country:

Posted 14 December 2020 - 07:55 AM

Some users of the Blender to MSTS exporter have seen the error "Missing UVMap in: ...".
( To help everyone, I am moving some info from the private threads to the public section of the forum.)

The short explanation is:

Each mesh that you export must have a uv map named 'UVMap'.

UVMap is the only map that gets exported to the .s file.

This is the default name provided by Blender so most users won't run into this error. But there are cases where this could be an issue:
eg
- an advanced user may have multiple uv maps with other names assigned. ( eg layered shaders, baking, etc )
- when importing a mesh from some other program it may come with different uv map names
- some non-english versions of Blender may use a different default name.

You can check or modify the name of a uv map like this:

Attached File  layernames.jpg (104.62K)
Number of downloads: 11

1. Click on your mesh object.
2. Select the mesh properties tab.
3. Open the UV Maps panel.
4. Double click on a map name to change it to 'UVMap'

If you have many mesh objects to fix, you can use something like this script:

import bpy

for mesh in bpy.data.meshes :           # for every mesh in the .blend file
    if len( mesh.uv_layers ) == 0:      #   if it doesn't have any uv maps
        mesh.uv_layers.new()            #     create one
    if not mesh.uv_layers.get('UVMap'): #   if it doesn't have one with the default name
        firstmap = mesh.uv_layers[0]    #     rename the first map
        firstmap.name = 'UVMap'         #     to the default name


Here are the steps for running a script:

Attached File  Image1.jpg (118.78K)
Number of downloads: 8

1. Choose the scripting tab.
2. Click 'New' to create a new script. By default its called Text.
3. Cut and paste the script above into the text block.
( hilite script in post 17, ctrl c, click on Blender text block, ctrl v )
4. Click 'Run Script' button
5. Look in the command window for a green check saying it ran OK.

I'll try to get some of this info into the manual for the next release ...


Wayne

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users