From 2067a1760251e8978bdbcd2abb59c86091ab7e1d Mon Sep 17 00:00:00 2001 From: vurtual Date: Tue, 29 Jun 2021 12:16:40 -0500 Subject: [PATCH] Fix linked objects throwing an error by checking if an object is in edit mode before trying to force it into object mode. --- ArmaToolbox/MDLexporter.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ArmaToolbox/MDLexporter.py b/ArmaToolbox/MDLexporter.py index 8e56183f..85727913 100644 --- a/ArmaToolbox/MDLexporter.py +++ b/ArmaToolbox/MDLexporter.py @@ -589,7 +589,8 @@ def exportObjectListAsMDL(myself, filePtr, applyModifiers, mergeSameLOD, objects objects = sorted(objects, key=lodKey) # Make sure the object is in OBJECT mode, otherwise some of the functions might fail - bpy.ops.object.mode_set(mode='OBJECT') + if (bpy.context.object.mode!='OBJECT'): + bpy.ops.object.mode_set(mode='OBJECT') # Write file header writeSignature(filePtr, 'MLOD')