diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-04-30 02:28:09 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-04-30 02:28:09 +0400 |
commit | 313d62df7020c7565dba57b831058449666f6fb7 (patch) | |
tree | 8c440925864fbc7f208496e5b020bdaecdba2590 | |
parent | 48446870a8981c28ee4c695823d12fb4419e56eb (diff) |
Get the edit-object when keying and checking editmode
-rw-r--r-- | source/blender/editors/animation/keyframing.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index 8a02aed15bc..e082678bcba 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -1273,7 +1273,7 @@ static int modify_key_op_poll(bContext *C) static int insert_key_exec(bContext *C, wmOperator *op) { Scene *scene = CTX_data_scene(C); - Object *ob = CTX_data_active_object(C); + Object *obedit = CTX_data_edit_object(C); bool ob_edit_mode = false; KeyingSet *ks = NULL; int type = RNA_enum_get(op->ptr, "type"); @@ -1301,7 +1301,7 @@ static int insert_key_exec(bContext *C, wmOperator *op) /* exit the edit mode to make sure that those object data properties that have been * updated since the last switching to the edit mode will be keyframed correctly */ - if (ob && (ob->mode & OB_MODE_EDIT) != 0 && ANIM_keyingset_find_id(ks, (ID *)ob->data)) { + if (obedit && ANIM_keyingset_find_id(ks, (ID *)obedit->data)) { ED_object_toggle_modes(C, OB_MODE_EDIT); ob_edit_mode = true; } |