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 | |
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')
-rw-r--r-- | source/blender/editors/transform/transform_conversions.c | 6 | ||||
-rw-r--r-- | source/blender/editors/transform/transform_generics.c | 4 |
2 files changed, 6 insertions, 4 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); diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index ad88bbe53f4..ca41a319b1d 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -374,7 +374,7 @@ static void recalcData_actedit(TransInfo *t) if ((saction->flag & SACTION_NOREALTIMEUPDATES) == 0) { for (ale = anim_data.first; ale; ale = ale->next) { /* set refresh tags for objects using this animation */ - ANIM_list_elem_update(t->scene, ale); + ANIM_list_elem_update(CTX_data_main(t->context), scene, ale); } } @@ -432,7 +432,7 @@ static void recalcData_graphedit(TransInfo *t) * BUT only if realtime updates are enabled */ if ((sipo->flag & SIPO_NOREALTIMEUPDATES) == 0) - ANIM_list_elem_update(t->scene, ale); + ANIM_list_elem_update(CTX_data_main(t->context), t->scene, ale); } /* do resort and other updates? */ |