Skip to content

Commit

Permalink
Fix animation when no channels are valid
Browse files Browse the repository at this point in the history
  • Loading branch information
julienduroure committed Aug 23, 2021
1 parent 9491ab0 commit ae019ea
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion addons/io_scene_gltf2/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit ae019ea

Please sign in to comment.