Repository: khronosgroup/gltf-blender-io
Issue: Blender throws keyframe error when exporting as gltf with animations - Key.path_resolve could not be resolved

Blender fails to export my 3d model with animations. This error is most probably my fault as I am inexperienced with blender and animations. Still can't find any way to fix the issue. The issue might also be related to the sample blender file that I am using.

```
Python: Traceback (most recent call last):
  File "E:\\Applications\\Blender\\2.92\\scripts\\addons\\io_scene_gltf2\\__init__.py", line 575, in execute
    return gltf2_blender_export.save(context, export_settings)
  File "E:\\Applications\\Blender\\2.92\\scripts\\addons\\io_scene_gltf2\\blender\\exp\\gltf2_blender_export.py", line 46, in save
    json, buffer = __export(export_settings)
  File "E:\\Applications\\Blender\\2.92\\scripts\\addons\\io_scene_gltf2\\blender\\exp\\gltf2_blender_export.py", line 63, in __export
    __gather_gltf(exporter, export_settings)
  File "E:\\Applications\\Blender\\2.92\\scripts\\addons\\io_scene_gltf2\\blender\\exp\\gltf2_blender_export.py", line 72, in __gather_gltf
    active_scene_idx, scenes, animations = gltf2_blender_gather.gather_gltf2(export_settings)
  File "E:\\Applications\\Blender\\2.92\\scripts\\addons\\io_scene_gltf2\\blender\\exp\\gltf2_blender_gather.py", line 39, in gather_gltf2
    animations += __gather_animations(blender_scene, export_settings)
  File "E:\\Applications\\Blender\\2.92\\scripts\\addons\\io_scene_gltf2\\blender\\exp\\gltf2_blender_gather.py", line 83, in __gather_animations
    animations_, merged_tracks = gltf2_blender_gather_animations.gather_animations(_blender_object, merged_tracks, len(animations), export_settings)
  File "E:\\Applications\\Blender\\2.92\\scripts\\addons\\io_scene_gltf2\\blender\\exp\\gltf2_blender_gather_animations.py", line 76, in gather_animations
    animation = __gather_animation(blender_action, blender_object, export_settings)
  File "E:\\Applications\\Blender\\2.92\\scripts\\addons\\io_scene_gltf2\\blender\\exp\\gltf2_blender_gather_animations.py", line 114, in __gather_animation
    channels=__gather_channels(blender_action, blender_object, export_settings),
  File "E:\\Applications\\Blender\\2.92\\scripts\\addons\\io_scene_gltf2\\blender\\exp\\gltf2_blender_gather_animations.py", line 150, in __gather_channels
    blender_action, blender_object, export_settings)
  File "E:\\Applications\\Blender\\2.92\\scripts\\addons\\io_scene_gltf2\\blender\\exp\\gltf2_blender_gather_cache.py", line 65, in wrapper_cached
    result = func(*args)
  File "E:\\Applications\\Blender\\2.92\\scripts\\addons\\io_scene_gltf2\\blender\\exp\\gltf2_blender_gather_animation_channels.py", line 83, in gather_animation_channels
    None)
  File "E:\\Applications\\Blender\\2.92\\scripts\\addons\\io_scene_gltf2\\blender\\exp\\gltf2_blender_gather_animation_channels.py", line 202, in __gather_animation_channel
    sampler=__gather_sampler(channels, blender_object, export_settings, bake_bone, bake_channel, bake_range_start, bake_range_end, action_name, driver_obj),
  File "E:\\Applications\\Blender\\2.92\\scripts\\addons\\io_scene_gltf2\\blender\\exp\\gltf2_blender_gather_animation_channels.py", line 263, in __gather_sampler
    export_settings
  File "E:\\Applications\\Blender\\2.92\\scripts\\addons\\io_scene_gltf2\\blender\\exp\\gltf2_blender_gather_cache.py", line 65, in wrapper_cached
    result = func(*args)
  File "E:\\Applications\\Blender\\2.92\\scripts\\addons\\io_scene_gltf2\\blender\\exp\\gltf2_blender_gather_animation_samplers.py", line 65, in gather_animation_sampler
    bake_bone, bake_channel, bake_range_start, bake_range_end, action_name, driver_obj, export_settings),
  File "E:\\Applications\\Blender\\2.92\\scripts\\addons\\io_scene_gltf2\\blender\\exp\\gltf2_blender_gather_cache.py", line 65, in wrapper_cached
    result = func(*args)
  File "E:\\Applications\\Blender\\2.92\\scripts\\addons\\io_scene_gltf2\\blender\\exp\\gltf2_blender_gather_animation_samplers.py", line 240, in __gather_input
    export_settings)
  File "E:\\Applications\\Blender\\2.92\\scripts\\addons\\io_scene_gltf2\\blender\\exp\\gltf2_blender_gather_cache.py", line 65, in wrapper_cached
    result = func(*args)
  File "E:\\Applications\\Blender\\2.92\\scripts\\addons\\io_scene_gltf2\\blender\\exp\\gltf2_blender_gather_animation_sampler_keyframes.py", line 240, in gather_keyframes
    step
  File "E:\\Applications\\Blender\\2.92\\scripts\\addons\\io_scene_gltf2\\blender\\exp\\gltf2_blender_gather_cache.py", line 90, in wrapper_bonecache
    result = func(*args)
  File "E:\\Applications\\Blender\\2.92\\scripts\\addons\\io_scene_gltf2\\blender\\exp\\gltf2_blender_gather_animation_sampler_keyframes.py", line 177, in get_bone_matrix
    drivers_to_manage = get_sk_drivers(obj_driver)
  File "E:\\Applications\\Blender\\2.92\\scripts\\addons\\io_scene_gltf2\\blender\\exp\\gltf2_blender_gather_cache.py", line 117, in wrapper_skdriverdiscover
    result = func(*args)
  File "E:\\Applications\\Blender\\2.92\\scripts\\addons\\io_scene_gltf2\\blender\\exp\\gltf2_blender_gather_drivers.py", line 54, in get_sk_drivers
    sk_name = child.data.shape_keys.path_resolve(get_target_object_path(sk_c.data_path)).name
ValueError: Key.path_resolve("key_blocks["Key 1"]") could not be resolved

location: <unknown location>:-1
```

**To Reproduce**
Steps to reproduce the behavior:
1. Open my model in Blender 2.92.0
2. Export as gltf with animation export turned on

**.blend file/ .gltf**
[model.zip](https://github.com/KhronosGroup/glTF-Blender-IO/files/6566628/model.zip)

**Version**
 - OS: Windows 10
 - Blender 2.92.0

Changed files:
addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_drivers.py

diff --git a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_drivers.py b/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_drivers.py
index ddbceab4..4dcad66f 100644
--- a/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_drivers.py
+++ b/addons/io_scene_gltf2/blender/exp/gltf2_blender_gather_drivers.py
@@ -51,7 +51,11 @@ def get_sk_drivers(blender_armature):
         idx_channel_mapping = []
         all_sorted_channels = []
         for sk_c in child.data.shape_keys.animation_data.drivers:
-            sk_name = child.data.shape_keys.path_resolve(get_target_object_path(sk_c.data_path)).name
+            # Check if driver is valid. If not, ignore this driver channel
+            try:
+                sk_name = child.data.shape_keys.path_resolve(get_target_object_path(sk_c.data_path)).name
+            except:
+                continue
             idx = shapekeys_idx[sk_name]
             idx_channel_mapping.append((shapekeys_idx[sk_name], sk_c))
         existing_idx = dict(idx_channel_mapping)