From b3a7a75a266de6765d8c04953c0dabce3c30c359 Mon Sep 17 00:00:00 2001 From: Bastien Montagne Date: Thu, 7 Jun 2018 12:47:00 +0200 Subject: Cleanup: remove moar G.main usages. Notes: * Really need to address RNA setters case, end up adding way too much G.main here these days... :/ * Added Main pointer into bAnimContext, helps a lot in anim code ;) --- source/blender/editors/interface/interface_anim.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to '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 5ed2713e5a7..10a23792e8f 100644 --- a/source/blender/editors/interface/interface_anim.c +++ b/source/blender/editors/interface/interface_anim.c @@ -42,6 +42,7 @@ #include "BKE_depsgraph.h" #include "BKE_fcurve.h" #include "BKE_global.h" +#include "BKE_main.h" #include "BKE_nla.h" #include "ED_keyframing.h" @@ -224,6 +225,7 @@ bool ui_but_anim_expression_create(uiBut *but, const char *str) void ui_but_anim_autokey(bContext *C, uiBut *but, Scene *scene, float cfra) { + Main *bmain = CTX_data_main(C); ID *id; bAction *action; FCurve *fcu; @@ -272,7 +274,7 @@ void ui_but_anim_autokey(bContext *C, uiBut *but, Scene *scene, float cfra) * because a button may control all items of an array at once. * E.g., color wheels (see T42567). */ BLI_assert((fcu->array_index == but->rnaindex) || (but->rnaindex == -1)); - insert_keyframe(reports, id, action, ((fcu->grp) ? (fcu->grp->name) : (NULL)), + insert_keyframe(bmain, reports, id, action, ((fcu->grp) ? (fcu->grp->name) : (NULL)), fcu->rna_path, but->rnaindex, cfra, ts->keyframe_type, flag); WM_event_add_notifier(C, NC_ANIMATION | ND_KEYFRAME | NA_EDITED, NULL); -- cgit v1.2.3