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

glTF exporter: fix crash when trying to export some muted driver(s)

parent 060d0e76
No related branches found
No related tags found
No related merge requests found
......@@ -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, 19),
"version": (1, 7, 20),
'blender': (2, 91, 0),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',
......
......@@ -56,6 +56,9 @@ def get_sk_drivers(blender_armature):
sk_name = child.data.shape_keys.path_resolve(get_target_object_path(sk_c.data_path)).name
except:
continue
# Do not take into account this driver if corresponding SK is disabled
if child.data.shape_keys.key_blocks[sk_name].mute is True:
continue
idx = shapekeys_idx[sk_name]
idx_channel_mapping.append((shapekeys_idx[sk_name], sk_c))
existing_idx = dict(idx_channel_mapping)
......@@ -65,7 +68,8 @@ def get_sk_drivers(blender_armature):
else:
all_sorted_channels.append(existing_idx[i])
drivers.append((child, tuple(all_sorted_channels)))
if len(all_sorted_channels) > 0:
drivers.append((child, tuple(all_sorted_channels)))
return tuple(drivers)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment