plane icon Welcome to Microsoft Flight Simulator’s SDK Q&A Platform!

You have questions regarding the SDK? DevMode Tools? SimConnect? You would like to submit an idea for future improvements, seek help or exchange knowledge? You’re in the right place.


Please take a moment to read the platform’s guidelines before you get started!


question

RomanDesign avatar image
RomanDesign asked RomanDesign commented

Asobo Blender Exporter - fatal error. Can't export objects.

I have tested the exporter in July and it appeared to work, it did create a proper file set for an object. However now, after a huge amount of time spent in modeling a terminal in my project, when I tried to export, it throws an error. What's even worse, the file I tested on, back in July, also returns an error. I installed Blender 3.1.2 and tried there - same error. All materials are converted. Please help, I can't work on the project if I can't export the files.

location: <unknown location>:-1
Error: Python: Traceback (most recent call last):
  File "C:\Users\Roman\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\io_scene_gltf2_msfs\io\msfs_multi_export.py", line 171, in execute
    MSFS_OT_MultiExportGLTF2.export(
  File "C:\Users\Roman\AppData\Roaming\Blender Foundation\Blender\3.1\scripts\addons\io_scene_gltf2_msfs\io\msfs_multi_export.py", line 45, in export
    bpy.ops.export_scene.gltf(
  File "D:\Program Files\Blender 3.1\3.1\scripts\modules\bpy\ops.py", line 132, in __call__
    ret = _op_call(self.idname_py(), None, kw)
RuntimeError: Error: Python: Traceback (most recent call last):
  File "D:\Program Files\Blender 3.1\3.1\scripts\addons\io_scene_gltf2\__init__.py", line 651, in execute
    return gltf2_blender_export.save(context, export_settings)
  File "D:\Program Files\Blender 3.1\3.1\scripts\addons\io_scene_gltf2\blender\exp\gltf2_blender_export.py", line 46, in save
    json, buffer = __export(export_settings)
  File "D:\Program Files\Blender 3.1\3.1\scripts\addons\io_scene_gltf2\blender\exp\gltf2_blender_export.py", line 71, in __export
    json = __fix_json(exporter.glTF.to_dict())
  File "D:\Program Files\Blender 3.1\3.1\scripts\addons\io_scene_gltf2\io\com\gltf2_io.py", line 1203, in to_dict
    result["materials"] = from_union([lambda x: from_list(lambda x: to_class(Material, x), x), from_none],
  File "D:\Program Files\Blender 3.1\3.1\scripts\addons\io_scene_gltf2\io\com\gltf2_io.py", line 56, in from_union
    assert False
AssertionError

location: D:\Program Files\Blender 3.1\3.1\scripts\modules\bpy\ops.py:132

location: <unknown location>:-1

Edit:

This has something to do with materials. If I create a test cube with a MSFS Srandard material it works OK and exports without errors - although all images are named image.png, image-1.png and so on, instead of material name or something meaningful. That also means multiple images for same materials on different objects?

But as soon as I change material from "Standard" to "Parallax" (which I use extensively in my sceneries) - I get the same error!

What's worse, if I check the "day/night cycle" checkbox even on "Standard" material - I get the same error immediately!

And checking "Collision Material" results in the same error!

So either "Parallax" or "Day/Nifht cycle" or "Collision Material" do not work, and result in the fatal error.

This is a major disaster! I have spent a lot of time on creating an Asset Library and converting/migrating all my materials (about a hundred of them) to the new format. Now it turns out nothing can't be exported, and basically this Asobo Blender Exporter is unusable, because it can't export parallax, day/night cycle and collision, which I always use. Please tell me there's something with my setup that's wrong and can be fixed, and it's not a dead end...

modelingblender
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

GutsherrBus9 avatar image
GutsherrBus9 answered RomanDesign commented

I had exactly the same problem with same error message a while ago. How i fixed it:

  1. Backup your project.
  2. Use Blender version 3.1!
  3. Reset Blender preferences to default with project open, then activate the MSFS exporter and only then save the project again. Make sure you have no other MSFS related importers or exporters activated in your plugin settings!

Also make sure to never save your project with several MSFS importers and exporters enabled. Stick to one as it might break materials otherwise.

1 comment
10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

RomanDesign avatar image RomanDesign commented ·

I posted my solution before I read yours, but it's almost identical! Thanks for the input.

1 Like 1 ·
RomanDesign avatar image
RomanDesign answered

I think I solved this issue, though it took most of the day eliminating different factors. In case it's useful to others, here's what helped:

1. Installing Blender 3.1.0 - that exact version, newer versions may be problematic.

2. Completely erasing blender user folder, where all settings and addons are stored, and not importing previous Blender settings. So a clean slate installation.

3. Fresh install of the exporter,

4. Adding and enabling the addons that I need, one by one.

So far it's working, though I haven't tested in MSFS yet. But my test files are exporting without errors and are creating plausible files. I have no idea what was corrupted in Blender settings or anywhere else in the Blender user folder that has resulted in those errors. But for now the issue is gone...


10 |10000

Up to 5 attachments (including images) can be used with a maximum of 4.8 MiB each and 23.8 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 5 attachments (including images) can be used with a maximum of 19.1 MiB each and 23.8 MiB total.