From 11e5f39fdc7732e8f13fd6b861d798959af0bae9 Mon Sep 17 00:00:00 2001 From: khreathor Date: Sat, 19 Jan 2019 05:10:21 +0100 Subject: [PATCH] Fix for the export error when there is no Shape Keys available --- tools/io_mesh_qfmdl/export_mdl.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/io_mesh_qfmdl/export_mdl.py b/tools/io_mesh_qfmdl/export_mdl.py index f9aa5ac2b..6b7237c4f 100644 --- a/tools/io_mesh_qfmdl/export_mdl.py +++ b/tools/io_mesh_qfmdl/export_mdl.py @@ -193,9 +193,10 @@ def make_frame(mesh, vertmap, idx): frame = MDL.Frame() frame.name = "frame" + str(idx) - shape_keys_amount = len(bpy.context.object.data.shape_keys.key_blocks) - if shape_keys_amount > idx: - frame.name = bpy.context.object.data.shape_keys.key_blocks[idx].name + if bpy.context.object.data.shape_keys: + shape_keys_amount = len(bpy.context.object.data.shape_keys.key_blocks) + if shape_keys_amount > idx: + frame.name = bpy.context.object.data.shape_keys.key_blocks[idx].name for v in vertmap: mv = mesh.vertices[v]