Unity-AssetDependencyGraph
Unity-AssetDependencyGraph copied to clipboard
NullReferenceException when trying to Explore Scenes
NullReferenceException: Object reference not set to an instance of an object
AssetDependencyGraph.CreateNode (UnityEngine.Object obj, System.String assetPath, System.Boolean isMainNode, System.Boolean hasDependencies) (at Assets/Shared/Utils/Editor/AssetDependencyGraph.cs:185)
AssetDependencyGraph.CreateDependencyNodes (System.String[] dependencies, UnityEditor.Experimental.UIElements.GraphView.Node parentNode, UnityEditor.Experimental.UIElements.GraphView.Group groupNode, System.Int32 depth) (at Assets/Shared/Utils/Editor/AssetDependencyGraph.cs:145)
AssetDependencyGraph.CreateDependencyNodes (System.String[] dependencies, UnityEditor.Experimental.UIElements.GraphView.Node parentNode, UnityEditor.Experimental.UIElements.GraphView.Group groupNode, System.Int32 depth) (at Assets/Shared/Utils/Editor/AssetDependencyGraph.cs:151)
AssetDependencyGraph.ExplodeAsset () (at Assets/Shared/Utils/Editor/AssetDependencyGraph.cs:127)
UnityEngine.Experimental.UIElements.Clickable.OnMouseUp (UnityEngine.Experimental.UIElements.MouseUpEvent evt) (at C:/buildslave/unity/build/Modules/UIElements/Clickable.cs:152)
UnityEngine.Experimental.UIElements.EventCallbackFunctor`1[TEventType].Invoke (UnityEngine.Experimental.UIElements.EventBase evt) (at C:/buildslave/unity/build/Modules/UIElements/Events/EventCallback.cs:62)
[...]
Testing in 2018.4 I removed the rest of the callstack as I believe it's irrelevant but let me know if you need it.
I did a little bit of investigation and it is due to userData never being set on the mainNode (scenes, in my test cases) I imagine that also means there is something depending on the mainNode which doesn't make much sense since it would mean there is circular dependency.
Let me know if you need additional testing, I would look into fixing it myself if I had time but I can't at the moment. If I end up doing it, I'll open a pull request.
Thanks again for sharing that tool!
As discussed with @LitchiSzu this is caused by the LightingData.asset
causing a circular dependency with the Scene asset
I have implemented a version that supports displaying circular dependencies...
I have implemented a version that supports displaying circular dependencies...
Nice! Would you like to create a PR for those changes?
Sorry so long to reply, I have uploaded to my program on GitHub。https://github.com/YaoYilin/UnityToolSet