Having an inspector open to a state that has a Parameter Driver will sometimes cause unity to spawn broken Animator windows and occasionally these will turn into "Failed to load..."
Attached are a few images of the symptoms of this bug
Nerd information:
in
AvatarParameterDriverEditor.GetCurrentController
,
EditorWindow.GetWindow
is called with focus = true (implicitly), this causes
EditorWindow.Show
to be called on the window which does nothing if the window's m_Parent is set, but in very rare occasions during domain reloads (usually due to entering play mode) m_Parent is null, this causes unity to try spawning a new actual window for the
AnimatorControllerTool
, which ends up with the
AnimatorControllerTool
existing in multiple places at once which makes a lot of the unity windowing system to break, these duplicates continue to pile up during repeated domain reloads and can only be cleared via either a unity restart or layout reload.
This is obviously caused by some form of internal unity bug but the VRChat SDK should also not be calling
GetWindow
with focus = true or calling
GetWindow
at all because
GetWindow
will create a window if one does not exist causing the inspector window to spawn an animator window when it is interacted with, this is clearly not desired behaviour.
Resources.FindObjectsOfTypeAll
should be used instead to find an
AnimatorControllerTool
without creating or focusing a window.
It might be even better to use
AssetDatabase.GetAssetPath
and
AssetDatabase.LoadAssetAtPath<AnimatorController>
to get the controller that contains the
VRCAvatarParameterDriver
directly.