Page MenuHome

Fix T65076: Missing EasingType implementation on the Dopesheet
ClosedPublic

Authored by Philipp Oeser (lichtwerk) on Oct 18 2019, 5:02 PM.

Details

Summary

EasingType was implemented rBdaccaa713b6e for the GraphEditor (but never
made it to the Dopesheet).

If you can select Easing Mode in the DopeSheet, then you should also be
able to select the associated Easing Type.

This is just monkey-porting existing code from the GraphEditor to the
DopeSheet.

Re: T65076

Diff Detail

Repository
rB Blender

Event Timeline

Sybren A. Stüvel (sybren) requested changes to this revision.Jan 6 2020, 2:01 PM

This functionality has been copied too many times already, yet another copy shouldn't be needed.

How about a function like this?

void ANIM_animdata_apply_callback(bAnimContext *ac, KeyframeEditFunc set_cb)
{
  ListBase anim_data = {NULL, NULL};
  bAnimListElem *ale;
  int filter;

  /* filter data */
  filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_LIST_VISIBLE | ANIMFILTER_FOREDIT |
            ANIMFILTER_NODUPLIS);
  ANIM_animdata_filter(ac, &anim_data, filter, ac->data, ac->datatype);

  for (ale = anim_data.first; ale; ale = ale->next) {
    ANIM_fcurve_keyframes_loop(NULL, ale->key_data, NULL, set_cb, calchandles_fcurve);
    ale->update |= ANIM_UPDATE_DEFAULT;
  }

  ANIM_animdata_update(ac, &anim_data);
  ANIM_animdata_freelist(&anim_data);
}

That should then be able to replace all the duplicates by calls like:

static void setipo_action_keys(bAnimContext *ac, short mode)
{
  ANIM_animdata_apply_callback(ac, ANIM_editkeyframes_ipo(mode));
}
This revision now requires changes to proceed.Jan 6 2020, 2:01 PM

I've reduced code duplication in the way I described above. @Philipp Oeser (lichtwerk) do you agree with this? If so, I'll commit it.

This revision is now accepted and ready to land.Mar 10 2020, 12:49 PM

I've reduced code duplication in the way I described above. @Philipp Oeser (lichtwerk) do you agree with this? If so, I'll commit it.

Thx!
Sorry this has been lying around (somewhat burried under higher prio stuff...)
Sound good to me, feel free to make you the author and commit, thx again!