Experimental Dependency Viewer

Welcome to the Very Experimental Dependency Viewer discussion thread. You can use this thread to ask for help, share feedback, and have discussions about the search-extensions package and its new Dependency Viewer tool.

Introduction
Lots of users have expressed a need for Unity to provide a built-in Dependency Viewer. There are some good packages on the Asset Store offering this kind of functionality but it would be better if it was part of the core workflows of Unity.

Using the Search backend we have been able to build a new Dependency Tool and a Dependency Search Provider. This tool tracks the global selection and shows which assets or GameObjects are Using or are Used by any selected objects. You will also have access to a series of Reports exploring the dependency Graph of your project (Unused assets, broken dependencies, Most used assets…).

Resources

Requirements
The Search Extensions package will work with Unity 2020.3 and any other versions higher than 2021.2.

  • If you are using 20.3: also install the com.unity.quicksearch@3.0.0-preview.14 package.
  • If you are using 21.2+ : Search extensions will use the built-in Search framework and do not require any other package.

Getting started

  • Installation instruction for Search Extension package are here.
  • Go into the Window->Search->Dependency Viewer menu.
  • Opening the Dependency Viewer for the first time will start building the Dependency Database. This process is asynchronous and is generally not too long (it depends on the size of your project).
  • When you see the message : Dependency indexing took 2188.93 ms and was saved at Library/dependencies_v1.index in the console you are good to go!
  • Each time you will select a new Asset or GameObject the Dependency Viewer will display the dependencies of the selected object.
  • This section of our documentation wiki explains in greater details what the Dependency Viewer is capable of.

Here are some links to nifty features of the Dependency viewer:

Current state
The tool is current in early alpha. Some clients have played a bit with it but we want to gather more feedback on usability, performance and stability. Some current limitations are:

  • There is not incremental update of the Dependency Database. If you want to update the dependencies you have to manually clicked the Build button.
  • This is a Dependency Viewer and not a Dependency Manager. This means you can reason about your project and better understand the links between assets but we have not build workflows to act on this information (no asset mass replace and no ways to easily fix broken dependencies).
  • We only show direct dependencies. That is dependencies at a single level deep of the selected assets.

What’s next
We want to know from the community if the current tool provides value. Then we want to improve the tool according to the feedback we will receive. Some features we are thinking about:

  • Incremental update of the Dependency Database.

  • Allow users to register custom Dependency indexer

  • Add new dependency reports (like Build dependencies)

  • Add more filtering options

  • Add Depth slider to show dependencies that more than a level deep from the selected object.

  • Add more advance workflows to manipulate Dependencies:

  • Mass replace of Assets

  • Helper to fix broken dependencies

  • Safe Delete of unused assets

Feedback
In terms of feedback, we’re especially looking for:

  • Can you think of any use cases that are not covered yet?

  • Are there any workflows that are unclear or missing?

  • Are there any issues or unclear parts in the documentation?

  • Is the Dependency Database accurate: are there dependencies that were not found?

  • Any feedback on usability and performance.

Please share your feedback in this thread.

How to report bugs
Since the feature is heavily in development if you find a bug, please log it using the Issue section of our Github project.

  • Attach a (stripped) project when there are issues.

Have a look at this page for more information and best practices around bug reporting.

Thank you for your interest, we’re looking forward to your feedback!

26 Likes

First feedback: really nice first version!

I have listed unused assets in the dependency viewer and now I want to select multiple assets from that list in the project window in order to perform an action on them ( delete or move )
But when I right click > select it only selects one asset in the project browser

I know its not a smart thing to delete all unused assets but its just an example of multi-select from list and synchronise selected items in the project window

Alternatively allow deleting multiple selected assets from disk via the decency viewer


One thing that may be nice in order to see if there are referenced assets inside a folder in the project window,
is to have an indication of used count on the folder of all items inside the folder.
or some other indicator that it contains referenced items.
This way I can quickly see in the project window if a folder is empty of referenced items or not.

Or just an 0 next to the folder when there are no referenced assets inside the folder
Then I know if there is not a zero by the folder that there are items inside that are referenced.

Looks good for start thanks :slight_smile:

Questions/Propositions:

  • may be source assets size is important but in my experience I mostly dont care about source assets size and care vary much about imported assets sizes. So I need column for Imported Assets sizes.

  • Looks like you develop yet another way to track dependencies in project and it again have nothing to do with real dependencies that will work upon pressing build button. Am I wrong?

  • I want to select scene and see all textures, meshes and sounds that it depends on and their imported sizes that I will have in player if unload all and load only this scene. How can I do this?

  • will be very good to select scene and see all shader variant dependencies in it? and imported size of every shader variant and sum of ones.

  • one of hard questions in project is why this asset actually goes into build? Want to select asset and see path to root scene/scenes or other assets that act as root in real build asset collection process. So I can see all resource why asset was added to build

3 Likes

This is looking good so far. Most of my feedback is probably not what you are looking for, but I will give it anyways just in case.

  • I already know the answer, but it would be really nice if the window was made with UITookit instead of IMGUI. It gives developers a lot of power to be able to add functionality to the window, or even change how parts work which is just not possible with IMGUI. Even if it takes a bit of reflection, just having that possibility is very nice.

-Since this is just experiment I’m sure you would get to it anyway. But please use toolbar styling for the header/toolbar. I figured there is at least a small chance that you wouldn’t change it, so I wanted to make sure that it was said.

  • When selecting on of the items in the window, I find that I just want to see the the dependency info for that object, and maybe the inspector for it. But the project browser’s view goes to it, losing my place and expanding a bunch of folders. So it would be nice if selecting an item wouldn’t move the browser view, or at least an option to not.
    (I understand the project browser’s view is tied to selection, but I thought it was still worth mentioning)

That is all I have for now (I also agree with what others have said). I know it is just nitpicky stuff or out of scope, but there it is. I look forward to seeing further development!

2 Likes

That is not the goal short term, but clearly something we need to do medium/long term in collaboration with the UITK team.

Good point. Once we have a good idea of the direction the tool will take, we’ll work with a UI designer to standardize and cleanup the UI.

We can make the Ping object optional, this way it doesn’t change the selection or project view. Also we eventually want to have the inspector show more dependency info.

Yes optional ping may be good to have, so not loose the current selection.
And if you can still show the inspector without ping that may be a good thing too.

What do you think if I reuse the same search tracking preference for the dependency viewer. Would that make sense? If this option is turned off, no ping occurs when the selection changes.

I have added a way to see the object runtime size (if available and computable) compared to the asset file size.

This column take a bit of time to compute per asset, but it can be useful to figure out if an asset takes a lot of memory at runtime.

3 Likes

Runtime Size is very welcome indeed. Thats a great addition.

For the preferences I would just add a new line with “Track the current selection in the Dependency View”
Or if you want to keep it a single checkbox :" Track the current selection in the Search view & Dependency View"
So that it describes what it affects in detail.

And for me Folder indicators to show if they are empty would be a big help as I’m trying to use it to clean a project.

1 Like

Hi Lars would you clarify what you mean with emtoy Folder indicator? Are you saying folder shouls be displayed in the Dependency Viewer and have a special badge if they are empty?

1 Like

In the project window it could just show 0 next to it when its empty of referenced items
( they can still be full of non referenced items )

I don’t mean in the dependency viewer

7444631--912782--referenced.png

All good! I understand :slight_smile: We will take notes on this.

1 Like

This is so good!

I gave it a quick look when you announced it and tried the dependency viewer. It’s pretty good!

What I didn’t notice was the dependency graph viewer (awesome), and the project browser integration (double awesome!)

So this is a really great feature. I need to clean up a ton of folders with textures where we might be using one or two in each folder, so this should speed up my work with that greatly!

Feedback:

  • The Project browser integration can’t show numbers correctly for > 100 dependencies (so 108 dependencies looks like 08)
  • The Project browser integration doesn’t activate before we’ve opened the dependency viewer and selected an asset. Is it possible to add an option for this to happen on startup? I can see you not doing it due to startup time, but I’d be happy to pay for the cost.
  • Dependency graph is cool, but it would be nice to have arrows on the lines showing the direction of the dependency
  • Dependency graph scrolling is a bit crazy. I think it tries to use the mouse position to decide how to scroll like the Animator window does, as where the mouse is has an effect on what happens, but it for sure doesn’t work well in the dep graph.

Again, great work, thanks for this tool!

4 Likes

Hi there! Great tool so far! Some feedback from me too:

  1. For me personally, the horizontal dark lines are making everything more cluttered and harder to read.
    I like the clean background like in all the other Unity windows.

  2. I would like to have the asset path split into 2, asset folder and asset name, so we can better view the project organization. I know this is not a project organizer, but maybe for the future an option to right-click > Move to folder option would be great.

  3. The graph viewer always shows an empty window:
    7512866--926366--upload_2021-9-22_11-34-43.png
    7512866--926365--upload_2021-9-22_11-34-13.png

Thanks and have a great day!

2 Likes

Thanks for the great feedback.

Clearly something we will fix.

At first this was by design. After some discussion with other users will add a preference to select when you want the dependency provider to initialize. (i.e. at startup, first time you open the dependency viewer, never)

Absolutely. We haven’t disclosed much about the Dependency Graph Viewer because at the moment it is very just a toy. We need to explorer many advance UX workflow to make it very useful. Right now it lacks a lot of UX to browse dependencies.

Clearly something we can explore and provide a preference for it.

This is possible in >=2021.2 by adding new Search Table Columns.

Start dragging assets from the project browser into that view and then expand dependencies by clicking the little +.

If you want more fun, once you have a few dependency floating around. Right click in an empty space and select Layout > Spring

2 Likes

Oh beautiful, thanks for the answers! I missed that. A big text saying Drag assets here is really needed :smile:

After installing the dependency viewer package, I started getting this warning at seemingly arbitrary times:

7516427--927149--upload_2021-9-23_13-8-30.png

Is that coming from the package?

Oh, yes I need to deploy a new version of the search extension package since now vertices and faces are built-in scene filters in the QS package.

I will try to do this today or tomorrow.

4 Likes

Can you retry with

"com.unity.search.extensions": "https://github.com/Unity-Technologies/com.unity.search.extensions.git#bb0105bd0f32157d9066cc47a76badda44aadd4e",

Did it, seems to have fixed the problem (no warning after a few hours of work and also using the dep viewer)

1 Like