Skip to content
Snippets Groups Projects
Commit a8c700d4 authored by Julien Duroure's avatar Julien Duroure
Browse files

glTF exporter: fix animation export when no channels are valid

parent 1757ec91
Branches
Tags
No related merge requests found
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
bl_info = { bl_info = {
'name': 'glTF 2.0 format', 'name': 'glTF 2.0 format',
'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors', 'author': 'Julien Duroure, Scurest, Norbert Nopper, Urs Hanselmann, Moritz Becher, Benjamin Schmithüsen, Jim Eckerlein, and many external contributors',
"version": (1, 7, 22), "version": (1, 7, 23),
'blender': (2, 91, 0), 'blender': (2, 91, 0),
'location': 'File > Import-Export', 'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0', 'description': 'Import-Export as glTF 2.0',
......
...@@ -118,7 +118,8 @@ def gather_animation_channels(blender_action: bpy.types.Action, ...@@ -118,7 +118,8 @@ def gather_animation_channels(blender_action: bpy.types.Action,
blender_action.name, blender_action.name,
obj, obj,
False) False)
channels.append(channel) if channel is not None:
channels.append(channel)
else: else:
for channel_group in __get_channel_groups(blender_action, blender_object, export_settings): for channel_group in __get_channel_groups(blender_action, blender_object, export_settings):
......
...@@ -121,12 +121,12 @@ def __gather_animation(blender_action: bpy.types.Action, ...@@ -121,12 +121,12 @@ def __gather_animation(blender_action: bpy.types.Action,
print_console("WARNING", "Animation '{}' could not be exported. Cause: {}".format(name, error)) print_console("WARNING", "Animation '{}' could not be exported. Cause: {}".format(name, error))
return None return None
# To allow reuse of samplers in one animation,
__link_samplers(animation, export_settings)
if not animation.channels: if not animation.channels:
return None return None
# To allow reuse of samplers in one animation,
__link_samplers(animation, export_settings)
export_user_extensions('gather_animation_hook', export_settings, animation, blender_action, blender_object) export_user_extensions('gather_animation_hook', export_settings, animation, blender_action, blender_object)
return animation return animation
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment