[Bf-blender-cvs] [20d516d] master: Fix: Autokeying of buttons doesn't work on NLA Strip properties

Joshua Leung noreply at git.blender.org
Fri Jul 24 04:24:41 CEST 2015


Commit: 20d516dc35dadfe549b6cacc21611deca5ad9161
Author: Joshua Leung
Date:   Fri Jul 24 14:15:28 2015 +1200
Branches: master
https://developer.blender.org/rB20d516dc35dadfe549b6cacc21611deca5ad9161

Fix: Autokeying of buttons doesn't work on NLA Strip properties

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

M	source/blender/editors/interface/interface_anim.c

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

diff --git a/source/blender/editors/interface/interface_anim.c b/source/blender/editors/interface/interface_anim.c
index f6757b3..37895a7 100644
--- a/source/blender/editors/interface/interface_anim.c
+++ b/source/blender/editors/interface/interface_anim.c
@@ -223,8 +223,25 @@ void ui_but_anim_autokey(bContext *C, uiBut *but, Scene *scene, float cfra)
 	bool special;
 
 	fcu = ui_but_get_fcurve(but, NULL, &action, &driven, &special);
-
-	if (fcu && !driven) {
+	
+	if (fcu == NULL)
+		return;
+	
+	if (special) {
+		/* NLA Strip property */
+		if (IS_AUTOKEY_ON(scene)) {
+			ReportList *reports = CTX_wm_reports(C);
+			PointerRNA ptr = {{NULL}};
+			PropertyRNA *prop = NULL;
+			int index;
+			
+			UI_context_active_but_prop_get(C, &ptr, &prop, &index);
+			
+			insert_keyframe_direct(reports, ptr, prop, fcu, cfra, 0);
+			WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
+		}
+	}
+	else if (!driven) {
 		id = but->rnapoin.id.data;
 
 		/* TODO: this should probably respect the keyingset only option for anim */




More information about the Bf-blender-cvs mailing list