Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

[RELEASED] Find References To Asset

Discussion in 'Assets and Asset Store' started by OmniShader, Dec 2, 2023.

  1. OmniShader

    OmniShader

    Joined:
    Feb 12, 2022
    Posts:
    45


    Find References To Asset on the Unity Asset Store

    Discord Support | Email

    Find References To Asset
    is a lite editor tool that performs a reverse search, finding all references to a specified asset. It's simple to use, supports finding multiple assets simultaneously, and super fast with near-instant results even on massive projects!

    This tool may be your single most-often used tool once you have it, particularly for developers and artists. It's extraordinarily useful for debugging, tracking how assets are used, or if they're unused even.

    Features
    • Ultra-fast, near-instant results
    • Auto-search selected asset on open
    • Support for multiple assets search
    • Option to exclude assets not in the build
    • Click search results to quickly ping the asset
    • Search for previous results to recursively look up ancestor references
    Note: This tool relies on ripgrep for its ultra speed (up to 10x faster than grep), a freely downloadable command-line tool available on Macs, Windows, and Linux. ripgrep is so fast, there is no need for indexing or caching files like alternative search solutions.

    That's it, I hope you love it!
    It's unbelievable that a tool as useful and convenient as this is not included in Unity. Once you have this, it is absolutely indispensable.

    *Note that this reverse asset search is NOT replicable with any built-in Unity methods or search functionality, as this kind of search is very difficult to do efficiently without tools like ripgrep.
     
    Last edited: Feb 13, 2024
  2. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,404
    That's a pretty bold statement when there's AssetDatabase.GetDependencies(..), which I'd trust to give me correct results. I'm skeptical when I read "grep" which implies regex parsing of YAML files. Speed is not the big value proposition, it's correctness.
     
  3. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    2,482
    I think it's bad form to dunk on someone's asset, even while it's labeled as a Pending Release. Maybe turn it into a question instead of a dismissive criticism based on nothing but their announcement.
     
  4. OmniShader

    OmniShader

    Joined:
    Feb 12, 2022
    Posts:
    45
    Thank you for the interest already! It's not even released :)
     
  5. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,404
    You're right, thanks for calling it out. I'll give it the benefit of the doubt.

    What I don't see - in the description - is how this is any improvement over the script API and the build analytics you already get from Unity. Bold marketing speech just triggers me in such a case.

    Also, I have this "show dependencies of an asset" feature in a free AssetInspector package, plus everything else one can learn about an asset using the built-in API. I don't go around calling this "unbelievable". It just isn't.
     
  6. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,624
    I believe that what the tool provides is the inverse of "GetDependencies". For example, it does not display "Material A depends on Texture B," but rather "Texture B is referenced by Material A".

    Such functionality is very useful and needed, I need such thing almost daily. I remember asking the Unity Search team if their tool supports it, but I cannot recall their response.
     
  7. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,404
    I see! The clue is in "reverse search". Okay, granted, that's useful. ;)
     
    Peter77 likes this.
  8. CodeSmile

    CodeSmile

    Joined:
    Apr 10, 2014
    Posts:
    6,404
    So I woke up this morning and feel compelled to apologize for my behaviour! I'm sorry!

    I had already been triggered earlier that day due to Intel's marketing bullcrap about their "AI Assist" overclocking software - which has nothing to do with AI and has been a built-in feature of computers for a decade: automatic overclocking. And then some other assets that were doing the Steve Jobs' marketing approach ... it's AMAZING and .. (imagine more superlative yet utterly meaningless adjectives here) .. :rolleyes:

    Just to explain where I was coming from.

    Still I'm wondering: couldn't this be done using GetDependencies? It would require an initial up-front scan of all assets to get their dependencies, but once you have that and store that info, subsequent scans will be faster AND it's guaranteed to be 100% correct and wouldn't have to rely on a cmd tool that may or may not have been tested whether it produces correct results on all three editor platforms.

    A tip on messaging: "references to asset" is somehow, in my mind at least, vague.
    If it were "asset is used by" it would better convey the idea that you're inspecting an asset and get to see where it's being used. It's sort of the subtitle of the image but it has this opposing views conflict in it "references to" and "used by", the latter explaining the former. One should suffice. If "references to asset" needs an explanation, it's better to use the explanation.
     
    Last edited: Dec 3, 2023
  9. OmniShader

    OmniShader

    Joined:
    Feb 12, 2022
    Posts:
    45
    Yes this is a "reverse-search" tool, and no it cannot be done using AssetDatabase.GetDependencies() unless you were to call that on every file and then aggregate the results leading to a certain asset, and while you could cache this upfront the results would be massive and get out of date fast. My guess Unity does not offer this is because it is very difficult to implement efficiently. This tool is only made possible through the use of ripgrep, a version of grep that is up to 10x faster in file searches. The tool's results are 100% accurate, I have been using it myself almost daily for the past year. Anyways, hope this is accepted into the store soon so you can try it out :), and thanks again for noticing!
     
    Last edited: Dec 4, 2023
  10. OmniShader

    OmniShader

    Joined:
    Feb 12, 2022
    Posts:
    45
    Last edited: Feb 28, 2024
  11. newbie_unity

    newbie_unity

    Joined:
    Feb 20, 2021
    Posts:
    1
    what's the compatible range of unity? does it work on older unity editor version, such as 5.x, 2018, 2020, 2022 ?
     
  12. OmniShader

    OmniShader

    Joined:
    Feb 12, 2022
    Posts:
    45
    The tool has been verified to work on Unity 2021 throuugh 2023. I believe it also works on 2020 (not 100% sure). That said, it is a simple C# tool so I do not see why it should not work with prior Unity versions. Bests.