diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-07 13:47:00 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-07 13:48:29 +0300 |
commit | b3a7a75a266de6765d8c04953c0dabce3c30c359 (patch) | |
tree | 98d27c5eb1d6573235c42e6e4b14137a8cee5c49 /source/blender/editors/transform/transform_conversions.c | |
parent | 16017178b24c9c84df5c1114fae8dce4796c6c26 (diff) |
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 ;)
Diffstat (limited to 'source/blender/editors/transform/transform_conversions.c')
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/transform/transform_conversions.c b/source/blender/editors/transform/transform_conversions.c index a9b12a34593..6ce8d9dc5ac 100644 --- a/source/blender/editors/transform/transform_conversions.c +++ b/source/blender/editors/transform/transform_conversions.c @@ -5782,6 +5782,7 @@ static void clear_trans_object_base_flags(TransInfo *t) // NOTE: context may not always be available, so must check before using it as it's a luxury for a few cases void autokeyframe_ob_cb_func(bContext *C, Scene *scene, View3D *v3d, Object *ob, int tmode) { + Main *bmain = CTX_data_main(C); ID *id = &ob->id; FCurve *fcu; @@ -5813,7 +5814,7 @@ void autokeyframe_ob_cb_func(bContext *C, Scene *scene, View3D *v3d, Object *ob, if (adt && adt->action) { for (fcu = adt->action->curves.first; fcu; fcu = fcu->next) { fcu->flag &= ~FCURVE_SELECTED; - insert_keyframe(reports, id, adt->action, + insert_keyframe(bmain, reports, id, adt->action, (fcu->grp ? fcu->grp->name : NULL), fcu->rna_path, fcu->array_index, cfra, ts->keyframe_type, flag); @@ -5898,6 +5899,7 @@ void autokeyframe_ob_cb_func(bContext *C, Scene *scene, View3D *v3d, Object *ob, // NOTE: context may not always be available, so must check before using it as it's a luxury for a few cases void autokeyframe_pose_cb_func(bContext *C, Scene *scene, View3D *v3d, Object *ob, int tmode, short targetless_ik) { + Main *bmain = CTX_data_main(C); ID *id = &ob->id; AnimData *adt = ob->adt; bAction *act = (adt) ? adt->action : NULL; @@ -5950,7 +5952,7 @@ void autokeyframe_pose_cb_func(bContext *C, Scene *scene, View3D *v3d, Object *o * NOTE: this will do constraints too, but those are ok to do here too? */ if (pchanName && STREQ(pchanName, pchan->name)) { - insert_keyframe(reports, id, act, + insert_keyframe(bmain, reports, id, act, ((fcu->grp) ? (fcu->grp->name) : (NULL)), fcu->rna_path, fcu->array_index, cfra, ts->keyframe_type, flag); |