diff --git a/io_scene_gltf2/__init__.py b/io_scene_gltf2/__init__.py index e9e6660e81bd87d997078a0ae3cca1af7b7c2bac..616ba2f21ccf3a06ca9d492962ad26d767df8b4a 100755 --- a/io_scene_gltf2/__init__.py +++ b/io_scene_gltf2/__init__.py @@ -4,7 +4,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": (3, 3, 6), + "version": (3, 3, 7), 'blender': (3, 3, 0), 'location': 'File > Import-Export', 'description': 'Import-Export as glTF 2.0', @@ -372,6 +372,14 @@ class ExportGLTF2_Base: default=True ) + export_nla_strips_merged_animation_name: StringProperty( + name='Merged Animation Name', + description=( + "Name of single glTF animation to be exported" + ), + default='Animation' + ) + export_def_bones: BoolProperty( name='Export Deformation Bones Only', description='Export Deformation bones only (and needed bones for hierarchy)', @@ -568,6 +576,7 @@ class ExportGLTF2_Base: else: export_settings['gltf_def_bones'] = False export_settings['gltf_nla_strips'] = self.export_nla_strips + export_settings['gltf_nla_strips_merged_animation_name'] = self.export_nla_strips_merged_animation_name export_settings['gltf_optimize_animation'] = self.optimize_animation_size else: export_settings['gltf_frame_range'] = False @@ -863,6 +872,8 @@ class GLTF_PT_export_animation_export(bpy.types.Panel): layout.prop(operator, 'export_frame_step') layout.prop(operator, 'export_force_sampling') layout.prop(operator, 'export_nla_strips') + if operator.export_nla_strips is False: + layout.prop(operator, 'export_nla_strips_merged_animation_name') layout.prop(operator, 'optimize_animation_size') row = layout.row() diff --git a/io_scene_gltf2/blender/exp/gltf2_blender_gather.py b/io_scene_gltf2/blender/exp/gltf2_blender_gather.py index 6153bc3369672a0186e3b49d8298dac58770d47b..4eb8baed427446a255459c5f36281ba13e48ac36 100755 --- a/io_scene_gltf2/blender/exp/gltf2_blender_gather.py +++ b/io_scene_gltf2/blender/exp/gltf2_blender_gather.py @@ -94,9 +94,12 @@ def __gather_animations(blender_scene, export_settings): if export_settings['gltf_nla_strips'] is False: # Fake an animation with all animations of the scene merged_tracks = {} - merged_tracks['Animation'] = [] + merged_tracks_name = 'Animation' + if(len(export_settings['gltf_nla_strips_merged_animation_name']) > 0): + merged_tracks_name = export_settings['gltf_nla_strips_merged_animation_name'] + merged_tracks[merged_tracks_name] = [] for idx, animation in enumerate(animations): - merged_tracks['Animation'].append(idx) + merged_tracks[merged_tracks_name].append(idx) to_delete_idx = []