[Bf-blender-cvs] [10bbce3] master: UI: avoid getting the active button when its already known

Campbell Barton noreply at git.blender.org
Wed May 4 18:42:39 CEST 2016


Commit: 10bbce30a9262b7a6764533dad1eaf8ebc8a7313
Author: Campbell Barton
Date:   Thu May 5 02:21:29 2016 +1000
Branches: master
https://developer.blender.org/rB10bbce30a9262b7a6764533dad1eaf8ebc8a7313

UI: avoid getting the active button when its already known

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

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 0683157..8892449 100644
--- a/source/blender/editors/interface/interface_anim.c
+++ b/source/blender/editors/interface/interface_anim.c
@@ -232,13 +232,8 @@ void ui_but_anim_autokey(bContext *C, uiBut *but, Scene *scene, float cfra)
 		if (IS_AUTOKEY_ON(scene)) {
 			ReportList *reports = CTX_wm_reports(C);
 			ToolSettings *ts = scene->toolsettings;
-			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, ts->keyframe_type, 0);
+			insert_keyframe_direct(reports, but->rnapoin, but->rnaprop, fcu, cfra, ts->keyframe_type, 0);
 			WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
 		}
 	}
@@ -249,13 +244,8 @@ void ui_but_anim_autokey(bContext *C, uiBut *but, Scene *scene, float cfra)
 		if (IS_AUTOKEY_ON(scene)) {
 			ReportList *reports = CTX_wm_reports(C);
 			ToolSettings *ts = scene->toolsettings;
-			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, ts->keyframe_type, INSERTKEY_DRIVER);
+			insert_keyframe_direct(reports, but->rnapoin, but->rnaprop, fcu, cfra, ts->keyframe_type, INSERTKEY_DRIVER);
 			WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL);
 		}
 	}




More information about the Bf-blender-cvs mailing list