From 0aa618c849ffef7b11cef81f1712b89e0b0e337b Mon Sep 17 00:00:00 2001
From: Julien Duroure <julien.duroure@gmail.com>
Date: Sun, 4 Jul 2021 17:51:43 +0200
Subject: [PATCH] glTF exporter: Make sure that addon that changes root gltf
 are taken into account

---
 io_scene_gltf2/__init__.py                         | 2 +-
 io_scene_gltf2/blender/exp/gltf2_blender_export.py | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py
index 0f9ce6bb8..4c7582294 100755
--- a/io_scene_gltf2/__init__.py
+++ b/io_scene_gltf2/__init__.py
@@ -15,7 +15,7 @@
 bl_info = {
     'name': 'glTF 2.0 format',
     'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin SchmithĂĽsen, Jim Eckerlein, and many external contributors',
-    "version": (1, 7, 14),
+    "version": (1, 7, 15),
     'blender': (2, 91, 0),
     'location': 'File > Import-Export',
     'description': 'Import-Export as glTF 2.0',
diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_export.py b/io_scene_gltf2/blender/exp/gltf2_blender_export.py
index ce2b97217..5cb984793 100755
--- a/io_scene_gltf2/blender/exp/gltf2_blender_export.py
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_export.py
@@ -63,11 +63,13 @@ def __export(export_settings):
     __gather_gltf(exporter, export_settings)
     buffer = __create_buffer(exporter, export_settings)
     exporter.finalize_images()
-    json = __fix_json(exporter.glTF.to_dict())
 
     export_user_extensions('gather_gltf_hook', export_settings, exporter.glTF)
     exporter.traverse_extensions()
 
+    # now that addons possibly add some fields in json, we can fix in needed
+    json = __fix_json(exporter.glTF.to_dict())
+
     return json, buffer
 
 
-- 
GitLab