Navigate to and select AnimationState through code?

An example of what I’m trying to attempt is similar to Debug.Log(string, CONTEXT), where clicking the debug log focuses the context (i.e GameObject).

I have an AnimationController with a large amount of AnimationStates (and sub-state machines), and an editor script that searches for a specified state in the controller. Is it possible to automatically select the resulting state in the Inspector and/or Animator window?

  1. Code searches for desired state in controller
  2. The path to the desired state is logged in the console
    3. With animator open, navigate to the resulting state’s sub-state machine and select the state
1 Like

I figured out a semi-solution. I wasn’t able to navigate in the Animator, but I was able to select the resulting state using:
Selection.SetActiveObjectWithContext(state, state);