glTF exporter: avoid crash when apply modifiers + shapekeys

This commit is contained in:
Julien Duroure 2022-09-21 22:24:58 +02:00
parent ddc05b9140
commit bb77e697e1
Notes: blender-bot 2023-02-13 13:22:30 +01:00
Referenced by issue blender/blender#100749: Blender LTS: Maintenance Task 3.3
Referenced by issue blender/blender#100749, Blender LTS: Maintenance Task 3.3
2 changed files with 3 additions and 2 deletions

View File

@ -4,7 +4,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": (3, 4, 17),
"version": (3, 4, 18),
'blender': (3, 3, 0),
'location': 'File > Import-Export',
'description': 'Import-Export as glTF 2.0',

View File

@ -81,7 +81,8 @@ def extract_primitives(blender_mesh, uuid_for_skined_data, blender_vertex_groups
use_morph_tangents = use_morph_normals and use_tangents and export_settings[gltf2_blender_export_keys.MORPH_TANGENT]
key_blocks = []
if blender_mesh.shape_keys and export_settings[gltf2_blender_export_keys.MORPH]:
# Shape Keys can't be retrieve when using Apply Modifiers (Blender/bpy limitation)
if export_settings[gltf2_blender_export_keys.APPLY] is False and blender_mesh.shape_keys and export_settings[gltf2_blender_export_keys.MORPH]:
key_blocks = [
key_block
for key_block in blender_mesh.shape_keys.key_blocks