From 669b89d6a56dfebee45c4b72950d212da04d17df Mon Sep 17 00:00:00 2001
From: Julien Duroure <julien.duroure@gmail.com>
Date: Mon, 23 Aug 2021 19:05:21 +0200
Subject: [PATCH] glTF export: Add merge_animation_extensions_hook

---
 io_scene_gltf2/__init__.py                         | 2 +-
 io_scene_gltf2/blender/exp/gltf2_blender_gather.py | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py
index ccb4517de..325b6fc3b 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, 17),
+    "version": (1, 7, 18),
     '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_gather.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather.py
index 6f46918ac..6f68c19ee 100755
--- a/io_scene_gltf2/blender/exp/gltf2_blender_gather.py
+++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather.py
@@ -116,6 +116,10 @@ def __gather_animations(blender_scene, export_settings):
 
             to_delete_idx.append(anim_idx)
 
+            # Merging extensions
+            # Provide a hook to handle extension merging since there is no way to know author intent
+            export_user_extensions('merge_animation_extensions_hook', export_settings, animations[anim_idx], animations[base_animation_idx])
+
             # Merging extras
             # Warning, some values can be overwritten if present in multiple merged animations
             if animations[anim_idx].extras is not None:
-- 
GitLab