The blender exporter is unable to export packed textures

Version: SU - 1.5.13.0

Frequency: Consistently

Severity: High

Context: Export from blender

Bug description: No matter the texture setup, whether with the ms2024 section or that section disabled, I can’t get the textures to export from Blender. I am on 4.2.7 using the latest SDK blender tools, which was reinstalled. This causes all models to have pink textures in the sim. I have tried “keep original”, unchecked it, “Generate TextureLib”, unchecked it, and still nothing. I have tried to follow steps on other forum posts as well with no luck. The model does export as expected with all three files, but no textures being exported. I am exporting to the main project file created in 2024 SDK, into the package sources just like how I did in 2020. I feel like it is something I am missing, but I have not had this issue on any of my 2020 projects. Any help is appreciated.

Repro steps: Open any model in Blender 4+ and export using the multi-exporter.

Attachments:

Private attachments: Send a PM to @PrivateContent with the link to this topic and the link to download your content

Are your materials packed in blender?

Not sure what you mean by packed. I have tried connecting them directly as well as trying the MS2024 connection on the right, as seen in the pic above. I know both of those have worked for me in 2020. They are in my texture folder for the project just like I have always done.

By looking at your pic:

  • Keep original unchecked (as you have it)
  • Generate TextureLib needs to be checked

Packed means the resources for the .blend file are integrated with it, instead of being stored locally.

Last time I checked the textures had to be unpacked in the current folder for them to be exported correctly with the 2024 addon. In the 2020 addon, it worked with packed textures.

1 Like

Oh, yes I have all the textures stored locally in a textures folder inside the main blender file folder. I haven’t seen this issue where the model exports fine, even with the correct UV, but no textures being exported. I created the same model for 2020 and when I export it from blender 3.6 for 2020, it works just fine, but if I export with blender 4.2 with the 2024 multi-exporter, the textures don’t work.

Hello,

Indeed, it seems that the exporter has an issue with packed textures.

A fix has been implemented and will be integrated in a future SDK update.
I’ll let you know once it’s available.

Regards,
Boris

1 Like

I believe this is due to an issue with Blender/Khronos that Yasmine reported to Khronos already.

The copying of image files does not work in 4.2 like it does in 3.6. Instead of using the gltf path I use the path put into the texture folder textbox.

A suggested change to the code that suits my purposes is:

In msfs_multi_export.py the function export_gltf_textures


        for gltf_image in gltf_images:
            # uri image path in Blender 4.2 is not same as Blender 3.6 - does not use relative path added - ronh
            image_path = gltf_image.get("uri")
            if image_path is None:
                continue

            # added the 4.2 check - ronh
            if bpy.app.version < (4, 2, 0):
                image_path = os.path.join(gltf_dir_path, image_path)
            else:
                image_path = os.path.join(texture_dir, image_path)
            image_path = image_path.replace('/', '\\')
            image_path = os.path.abspath(image_path)

EDIT: this is probably not the correct fix, but it suits my purposes and puts the textures in the correct folder.

If the .png files are not packed, shouldn’t it export though? I have all custom textures that I have saved locally. I export them to the modellib folder for the project and texture folder for textures. If this is incorrect, please let me know the correct way. This was my process for 2020 and 3.6.

What do you have selected here?

image

I have always had export. Only one that made sense to me.

@Boris

I started using exporter 3.3.2 and I am getting the same behavior. Textures are not being exported, regardless of being unpacked and the paths being relative to the blender project.

I am on blender 3.6 LTS

Hello @vpilotfs,

Please create a separate bug report, as this does not appear to be the same issue.
Also, make sure to include a Blender file with textures that can reproduce the behavior.

Regards
Boris

First pack all Resources, then unpack with the first option

1 Like

hey @rhumbaflappy

Thanks for the tip. I tried it and it did not work.

Why not zip a .blend file that shows the problem, and attach it here? I would have a look.

Hello,
I fix has been made in the SU3 SDK about the export packed texture.
Can you confirm this is now working ?

Regards,
Boris

At least for me and my projects, it is still not working. I think the issue though is that blender is not exporting any .xml files for the textures. I have tried packing and unpacking textures and no luck. It could just be a setting I am overlooking, but I wasn’t having issues like this in 2020.

Well, after hours of no luck, I happen to stumble onto a solution. You can’t have anything in the label of the textures other than letters. Any _ or . will cause the textures to not export or the xml to be created. Now that I have taken those out, I now get the textures to export and the xml generated. What a headache this was to find.