glTF exporter: fix animation export when no channels are valid

This commit is contained in:
Julien Duroure 2021-08-23 22:24:15 +02:00
parent 1757ec91e5
commit a8c700d4eb
3 changed files with 6 additions and 5 deletions

View File

@ -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, 22),
"version": (1, 7, 23),
'blender': (2, 91, 0),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',

View File

@ -118,7 +118,8 @@ def gather_animation_channels(blender_action: bpy.types.Action,
blender_action.name,
obj,
False)
channels.append(channel)
if channel is not None:
channels.append(channel)
else:
for channel_group in __get_channel_groups(blender_action, blender_object, export_settings):

View File

@ -121,12 +121,12 @@ def __gather_animation(blender_action: bpy.types.Action,
print_console("WARNING", "Animation '{}' could not be exported. Cause: {}".format(name, error))
return None
# To allow reuse of samplers in one animation,
__link_samplers(animation, export_settings)
if not animation.channels:
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)
return animation