Find GOs which use a transparent shader [in editor]

Hi all,

Is there a quick way within the editor to find all the scene GOs that use a transparent shader? i.e. Transparent/Diffuse or Transparent/Cutout/Diffuse et al. I need to find all the Transparent derivatives

Are we talking an Editor script or can this be done via the Hierarchy find box?

Cheers,
Matt.

Well… You could use the shader renderqueue to determine this. But there may be better ways.

So something like this:

    public List<GameObject> GameObjectsWithTransparency () 
    {

        List<GameObject> result = new List<GameObject>();

        Renderer[] allRenderers = FindObjectsOfType<Renderer>();

        for (int i = 0; i < allRenderers.Length; i++) 
        {

            for (int j = 0; j < allRenderers[i].sharedMaterials.Length; j++)
            {

                if (allRenderers[i].sharedMaterials[j].shader.renderQueue >= 2450) {

                    result.Add(allRenderers[i].gameObject);

                    break;

                }

            }

        }

        return result;

    }