"Uncheck all" in Gizmos menu in Scene view?

How do I uncheck all the checkboxes under the column “gizmo” in the Gizmos menu, in the Scene view of the Unity Editor, without clicking each one individually? Our project has hundreds of these, and each time I need to help a new artist (or someone running a new beta install) with them, we have to mouse click each individually.

There is no official way (none I am aware of), but depending on your willingness to dig into deep private reflection stuff of UnityEditor.dll, you could write some editor code to do this.

Basically from what I see from the decompile, class AnnotationWindow controls the UI. It uses AnnotationUtility.GetAnnotations to obtain information about what classes have gizmos available and uses AnnotationUtility.SetGizmoEnabled to enable/disable the gizmo (SetIconEnabled to enable/disable the icon).

Let me try… yea, this one should work… here you go: Menu option Window/Disable All Gizmos to turn off everything in a blink.

using UnityEditor;
using System;
using System.Reflection;
  
public class DisableAllGizmos
{
    [MenuItem("Window/Disable All Gizmos")]
    static void DisableAllGizmosMenu()
    {
        var Annotation = Type.GetType("UnityEditor.Annotation, UnityEditor");
        var ClassId = Annotation.GetField("classID");
        var ScriptClass = Annotation.GetField("scriptClass");
        
        Type AnnotationUtility = Type.GetType("UnityEditor.AnnotationUtility, UnityEditor");
        var GetAnnotations = AnnotationUtility.GetMethod("GetAnnotations", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static);
        var SetGizmoEnabled = AnnotationUtility.GetMethod("SetGizmoEnabled", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static);
        var SetIconEnabled = AnnotationUtility.GetMethod("SetIconEnabled", BindingFlags.NonPublic | BindingFlags.Public | BindingFlags.Static);
  
        Array annotations = (Array)GetAnnotations.Invoke(null, null);
        foreach (var a in annotations)
        {
            int classId = (int)ClassId.GetValue(a);
            string scriptClass = (string)ScriptClass.GetValue(a);
  
            SetGizmoEnabled.Invoke(null, new object[] { classId, scriptClass, 0 });
            SetIconEnabled.Invoke(null, new object[] { classId, scriptClass, 0 });
        }
    }
}

One quick and easy way to hide all the gizmos is to open the Gizmos menu in the Scene viewer and make sure 3D Icons is checked. Then slide the size slider all the way to the left so they shrink down to nothing.

If you want to do something about it, and don’t feel like figuring all the reflection methods out, or have no time to do so, I’ve released an asset called VoltGizmos, which allows you to show/hide all gizmos/icons with one click, as well as create your own snapshots.

It’ll prove useful to you especially if you have lots of custom objects, which use gizmos, and the scene view feels more like a slideshow than a fluid experience, but you don’t want to toggle gizmos manually all the time, as it’s tiresome.

Here you can check the workflow comparison:

You can now use Icon[("icon_path")].in 2021.2:

#if UNITY_2021_2_OR_NEWER
    [Icon(k_IconPath)]
#endif
    public sealed class PhysicsBodyAuthoring : MonoBehaviour
    {
        const string k_IconPath = "Packages/com.unity.physics/Unity.Physics.Editor/Editor Default Resources/Icons/d_Rigidbody@64.png";

        PhysicsBodyAuthoring() {}
    }