Blender exporter doesn't export AO (UV2)

Version: 4.3.4

Frequency: Consistently

Severity: Blocker

3.6.15 version of blender, 4.3.4 version of addon. Can’t export AO(UV2)

Hello,

What do you mean by “Can’t export”

The texture xml is created ? Any error displayed in the blender console ?

We will need a blender sample that reproduce the issue. See 3) Provide Private Content

Regards,
Boris

Hello!

Instructions for reproducing the error:

  1. Create a cube
  2. Duplicate UV for cube. We should have two UVs for cube
  3. Create a new material for cube, place any checker texture in the AO(UV2) slot.
  4. Export to MSFS2024
  5. In MSFS2024, enable AO display mode.
  6. You will see that the Texture from the AO(uv2) channel will not work. At the same time, AO from the COMP map works.

My bad, we just checked again and indeed the AO is not exporting on 3.6 but also 4.2

I have logged a bug in our backlog.

Thank you

Regards,
Boris

Hello,

This is fixed in the SDK 1.5.2
Can you confirm ?

Regards,
Boris

@Yasmine this one is not fixed. If it was it is broken in 5.4.2 (edit)

There is a 1: in a loop that should be removed.

msfs_multi_export.py

            # Make sure that active uv layer is first in the list
            if active_render_index > 0:
                MSFS2024_MeshUtils.swap_uv_layers(obj, active_render_index, 0)
                print("order_uv_layers - swap uv layers", active_render_index, uv_layers)

            # Check if there is a UV2 layer
            uv2_layer_index = None
            #for i, uv_layer in enumerate(uv_layers[1:]): # changed ronh - the check later for 1 would be out by one
            for i, uv_layer in enumerate(uv_layers):
                print("order_uv_layers - check for UV2", i, uv_layer)
                if uv_layer.name == DefaultUV.UV2_NAME:
                    uv2_layer_index = i
                    break

Hello,

Why is it not fixed according to you?

This code is meant to find the UV2 channel, the UV0 is already set here:

# Make sure that active uv layer is first in the list             
if active_render_index > 0:
    MSFS2024_MeshUtils.swap_uv_layers(obj, active_render_index, 0)

    print("order_uv_layers - swap uv layers", active_render_index, uv_layers)

After that the loop start at 1 to ignore UV0

I agree that the loop starts at position 1 - but the check later then looks for it in position 1.

the loop retruns a result index of 0 not 1 if you skip the first one.

            # Make sure that active uv layer is first in the list
            if active_render_index > 0:
                MSFS2024_MeshUtils.swap_uv_layers(obj, active_render_index, 0)
                print("order_uv_layers - swap uv layers", active_render_index, uv_layers)

            # Check if there is a UV2 layer
            uv2_layer_index = None
            #for i, uv_layer in enumerate(uv_layers[1:]): # changed ronh - the check later for 1 would be out by one
            for i, uv_layer in enumerate(uv_layers):
                print("order_uv_layers - check for UV2", i, uv_layer)
                if uv_layer.name == DefaultUV.UV2_NAME:
                    uv2_layer_index = i
                    break

            print("order_uv_layers - uv2_layer_index", uv2_layer_index)
            if uv2_layer_index is None:
                uv2_layer_index = 1

            elif uv2_layer_index != 1:
                # Move uv2 layer at second place in uv_layers
                print("order_uv_layers - move uv2 layers", uv2_layer_index)
                MSFS2024_MeshUtils.swap_uv_layers(obj, uv2_layer_index, 1)

anyways - making this change makes the UV2 work for me.

Here is an example cube.

How it looks in Blender - both your code and my code are identical

Your code:

print statements to show logic added to your version

[SUBPROCESS][PROGRESS] 50
order_uv_layers - uv_layers <bpy_collection[2], UVLoopLayers>
order_uv_layers - active_render_index 0 <bpy_struct, MeshUVLoopLayer("UV1") at 0x0000022F2FBA2D38>
order_uv_layers - check for UV2 0 <bpy_struct, MeshUVLoopLayer("UV2") at 0x0000022F2FBA2DB8>
order_uv_layers - uv2_layer_index 0
order_uv_layers - move uv2 layers 0

[SUBPROCESS][PROGRESS_TEXT] Exporting basicaircraft
10:46:41 | INFO: Starting glTF 2.0 export
io_scene_gltf2_msfs_2024 (5, 4, 2.5)
gather_asset_hook - after 1
gather_asset_hook - after 2
10:46:41 | INFO: Extracting primitive: Cube.001
10:46:41 | INFO: Primitives created: 1
gather_gltf_hook - START 0 [<io_scene_gltf2.io.com.gltf2_io.Scene object at 0x0000022E85703490>] []
gather_gltf_hook - placeholder {}
10:46:41 | INFO: Finished glTF 2.0 export in 0.03636312484741211 s


[SUBPROCESS][PROGRESS_TEXT] Exporting Textures...

export_gltf_textures - EXPORT START - texture_dir before abs ../texture
 F:\MSFS 2024 Aircraft Projects\test_cube\PackageSources\SimObjects\Airplanes\testcube1000\common\model\basicaircraft.gltf
 F:\MSFS 2024 Aircraft Projects\test_cube\PackageSources\SimObjects\Airplanes\testcube1000\common\model
export_gltf_textures - same file F:\MSFS 2024 Aircraft Projects\test_cube\PackageSources\SimObjects\Airplanes\testcube1000\common\texture\Checker_UV2.png
 F:\MSFS 2024 Aircraft Projects\test_cube\PackageSources\SimObjects\Airplanes\testcube1000\common\texture\Checker_UV2.png
export_gltf_textures - same file F:\MSFS 2024 Aircraft Projects\test_cube\PackageSources\SimObjects\Airplanes\testcube1000\common\texture\UV_comp_noise.png
 F:\MSFS 2024 Aircraft Projects\test_cube\PackageSources\SimObjects\Airplanes\testcube1000\common\texture\UV_comp_noise.png
export_gltf_textures - same file F:\MSFS 2024 Aircraft Projects\test_cube\PackageSources\SimObjects\Airplanes\testcube1000\common\texture\Checker.png
 F:\MSFS 2024 Aircraft Projects\test_cube\PackageSources\SimObjects\Airplanes\testcube1000\common\texture\Checker.png

[SUBPROCESS][PROGRESS_TEXT] Generating Tex Lib...
[TEXTURELIB] New TextureLib generation started at 2025-09-16 10:46:41.612405
[TEXTURELIB] Generating XML for texture Checker.png:
[TEXTURELIB][Checker.png.xml] Done (skip).
[TEXTURELIB] Generating XML for texture UV_comp_noise.png:
[TEXTURELIB][UV_comp_noise.png.xml] Done (skip).
[TEXTURELIB] Generating XML for texture Checker_UV2.png:
[TEXTURELIB][Checker_UV2.png.xml] Done (skip).
[TEXTURELIB] Operation completed in 0.004

[SUBPROCESS][PROGRESS] 100

[SUBPROCESS][SUCCESS]
Info: Export Done!

result in sim

note the small squares - which is UV2 mapped to UV1

my change to code - remove 1:

[SUBPROCESS][PROGRESS] 50
order_uv_layers - uv_layers <bpy_collection[2], UVLoopLayers>
order_uv_layers - active_render_index 0 <bpy_struct, MeshUVLoopLayer("UV1") at 0x00000247B3A341E8>
order_uv_layers - check for UV2 0 <bpy_struct, MeshUVLoopLayer("UV1") at 0x00000247B3A341E8>
order_uv_layers - check for UV2 1 <bpy_struct, MeshUVLoopLayer("UV2") at 0x00000247B3A34268>
order_uv_layers - uv2_layer_index 1

[SUBPROCESS][PROGRESS_TEXT] Exporting basicaircraft
INFO Draco mesh compression is available, use library at F:\Program Files\Blender Foundation\Blender 4.2\4.2\python\lib\site-packages\extern_draco.dll
10:27:58 | INFO: Starting glTF 2.0 export
io_scene_gltf2_msfs_2024 (5, 4, 2.5)
gather_asset_hook - after 1
gather_asset_hook - after 2
10:27:58 | INFO: Extracting primitive: Cube.001
10:27:58 | INFO: Primitives created: 1
gather_gltf_hook - START 0 [<io_scene_gltf2.io.com.gltf2_io.Scene object at 0x00000247A47A6690>] []
gather_gltf_hook - placeholder {}
10:27:58 | INFO: Finished glTF 2.0 export in 0.02942943572998047 s


[SUBPROCESS][PROGRESS_TEXT] Exporting Textures...

export_gltf_textures - EXPORT START - texture_dir before abs ../texture
 F:\MSFS 2024 Aircraft Projects\test_cube\PackageSources\SimObjects\Airplanes\testcube1000\common\model\basicaircraft.gltf
 F:\MSFS 2024 Aircraft Projects\test_cube\PackageSources\SimObjects\Airplanes\testcube1000\common\model
export_gltf_textures - same file F:\MSFS 2024 Aircraft Projects\test_cube\PackageSources\SimObjects\Airplanes\testcube1000\common\texture\Checker_UV2.png
 F:\MSFS 2024 Aircraft Projects\test_cube\PackageSources\SimObjects\Airplanes\testcube1000\common\texture\Checker_UV2.png
export_gltf_textures - same file F:\MSFS 2024 Aircraft Projects\test_cube\PackageSources\SimObjects\Airplanes\testcube1000\common\texture\UV_comp_noise.png
 F:\MSFS 2024 Aircraft Projects\test_cube\PackageSources\SimObjects\Airplanes\testcube1000\common\texture\UV_comp_noise.png
export_gltf_textures - same file F:\MSFS 2024 Aircraft Projects\test_cube\PackageSources\SimObjects\Airplanes\testcube1000\common\texture\Checker.png
 F:\MSFS 2024 Aircraft Projects\test_cube\PackageSources\SimObjects\Airplanes\testcube1000\common\texture\Checker.png

[SUBPROCESS][PROGRESS_TEXT] Generating Tex Lib...
[TEXTURELIB] New TextureLib generation started at 2025-09-16 10:27:58.289665
[TEXTURELIB] Generating XML for texture Checker.png:
[TEXTURELIB][Checker.png.xml] Done (skip).
[TEXTURELIB] Generating XML for texture UV_comp_noise.png:
[TEXTURELIB][UV_comp_noise.png.xml] Done (skip).
[TEXTURELIB] Generating XML for texture Checker_UV2.png:
[TEXTURELIB][Checker_UV2.png.xml] Done (skip).
[TEXTURELIB] Operation completed in 0.008

[SUBPROCESS][PROGRESS] 100

[SUBPROCESS][SUCCESS]
Info: Export Done!

in sim - - note large squares (UV1) plus smaller squares for UV2

blend file

UV Checker debug_02_542_packed.zip (964.6 KB)

This topic has been automatically closed after 60 days of inactivity since it was marked as fixed.

If there is important new information about this same report, you can use the “Request reopen” button below to ask the moderation team to review it again.
For other issues or broader discussion, please open a new topic in the appropriate category.