Force Animation Window Repaint/Update

Hi

Is it possible to make an open Animation Window (an EditorWindow) update itself when the contents change?

I have a component which adds curves to the animation but they don’t show up unless I switch from dopesheet to curves. So far I’ve tried…

            UnityEditorInternal.InternalEditorUtility.RepaintAllViews();
            animationWindow.rootVisualElement.MarkDirtyRepaint();

but they don’t work.

Am having a similar issue here - it seems at one point in time this worked, and in a more recent reply to the answer it stopped working:

There’s probably a better way, but for anyone stumbling on this in the future, I was able to get this working via reflection:

var methodInfo = typeof(AnimationUtility).GetMethod("Internal_CallAnimationClipAwake", BindingFlags.NonPublic | BindingFlags.Static);
methodInfo.Invoke(null, new []{ animClip,  });