• RuntimesUnity
  • Bones drawn in OnSceneGUI flicker in inspector

This is an issue I've noticed for awhile, but investigated and found a fix today. Notice in this gif how the bone handles also render in the inspector randomly:

This is due to SpineHandles not checking if (Event.current.type != EventType.Repaint) when drawing its meshes and other rendering calls. Note this is how Handles works internally: https://github.com/Unity-Technologies/UnityCsReference/blob/0aa4923aa67e701940c22821c137c8d0184159b2/Editor/Mono/Handles.cs#L354C5

I was able to fix this by checking if the current event is a Repaint in each OnSceneGUI call in the Spine editor code, but it would probably be a better fix to check it in SpineHandles similar to how the Handles class works.

Related Discussions
...

@Noeski Sorry for the troubles. Thanks for finding a bugfix already, that's an aweseome find, very much appreciated! We will perform some tests on our end and will release a bugfix soon.

FYI: Unity has created a public issue tracker ticket here:
https://issuetracker.unity3d.com/issues/visual-artifacts-appear-on-gameobject-and-in-the-editor-windows-when-gameobject-with-onscenegui-and-graphics-dot-drawmeshnow-is-moved-in-scene-view-on-macos
We've just informed them of the available fix (or workaround) and that if the checks are officially required that their docs should mention that.