Reply To: Suggestion: Support Easings for GetClipWeight and GetTrackWeight

Slate Forums Support Suggestion: Support Easings for GetClipWeight and GetTrackWeight Reply To: Suggestion: Support Easings for GetClipWeight and GetTrackWeight

#2629
dgoyette
Participant

My changes are a bit sloppy, mostly because 1) I haven’t thoroughly tested this (and I’ve just used it on Animator Tracks so far), and 2) I didn’t properly account for how it probably doesn’t make sense to enable this for all possible tracks. So my changes just enable it across the board for all tracks, and I’ll just be careful about whether it acts weird in some cases.

So far this seems to work as I’d expect, even when adjusting a clip’s ClipWeight property in the inspector.

As far as the issue you mentioned, about non-linear cross blending, I wonder if that’s only an issue if two adjacent clips use a different easing function? In my case, I just set a single easing for the whole track, not for individual tracks. Or maybe my change is actually broken in some way I just haven’t noticed yet. 🙂

My changes were:

1) CameraTrack.cs: Moved public EaseType interpolation = EaseType.QuarticInOut; to the base class, so that all tracks can specify their interpolation.

2) CutsceneTrack.cs: Added easing to GetTrackWeights:

3) ActionClip.cs: Applied easing to the final GetClipWeight, which asks the track for its interpolation mode, and uses that easing. Referencing the track in this way is a bit ugly, but I didn’t see a cleaner way to go from a Clip to a Track.