[Bf-blender-cvs] [313d62d] master: Get the edit-object when keying and checking editmode

Campbell Barton noreply at git.blender.org
Wed Apr 30 00:29:14 CEST 2014


Commit: 313d62df7020c7565dba57b831058449666f6fb7
Author: Campbell Barton
Date:   Wed Apr 30 08:28:09 2014 +1000
https://developer.blender.org/rB313d62df7020c7565dba57b831058449666f6fb7

Get the edit-object when keying and checking editmode

===================================================================

M	source/blender/editors/animation/keyframing.c

===================================================================

diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c
index 8a02aed..e082678 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;
 	}




More information about the Bf-blender-cvs mailing list