From b5509f71af7c07920ee01db540ba5cef03a57cbb Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Fri, 5 Jun 2015 13:17:46 -0400 Subject: [PATCH] Ensure we're in object mode before exporting.. --- korman/operators/op_export.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/korman/operators/op_export.py b/korman/operators/op_export.py index 75c4d81..565e175 100644 --- a/korman/operators/op_export.py +++ b/korman/operators/op_export.py @@ -70,6 +70,10 @@ class ExportOperator(bpy.types.Operator): self.report({"ERROR"}, "Failed to create export directory") return {"CANCELLED"} + # We need to back out of edit mode--this ensures that all changes are committed + if context.mode != "OBJECT": + bpy.ops.object.mode_set(mode="OBJECT") + # Separate blender operator and actual export logic for my sanity e = exporter.Exporter(self) try: