From 0edc2ed962f960cc07f24bb4ca49d8ae802aa7ca Mon Sep 17 00:00:00 2001
From: Daniel Salazar <zanqdo@gmail.com>
Date: Tue, 20 Nov 2012 01:44:58 +0000
Subject: [PATCH] AnimAll: Inserting keyframes on lattices now works in edit
 mode too. Requested by Virgilio Vasconcelos @ BlenderPro!

---
 animation_animall.py | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/animation_animall.py b/animation_animall.py
index e291799e9..c20f64b1a 100644
--- a/animation_animall.py
+++ b/animation_animall.py
@@ -198,10 +198,18 @@ class ANIM_OT_insert_keyframe_animall(bpy.types.Operator):
                 bpy.ops.object.editmode_toggle()
         
         if Obj.type == 'LATTICE':
+            Mode = False
+            if context.mode != 'OBJECT':
+                Mode = not Mode
+                bpy.ops.object.editmode_toggle()
+            
             if context.window_manager.key_shape:
                 if Obj.active_shape_key:
                     for Point in Obj.active_shape_key.data:
                         Point.keyframe_insert('co')
+            
+            if Mode:
+                bpy.ops.object.editmode_toggle()
         
         if Obj.type == 'CURVE':
             Mode = False
-- 
GitLab