Fix "Go to scene hierarchy" doing nothing on non-scene assets - #7
Merged
Conversation
The Asset List context item was shown for every single selection, but only assets that are part of a GameObject (Components, and the Mesh under a MeshFilter/SkinnedMeshRenderer) carry a TreeNode. On any other asset the item appeared yet clicking it silently did nothing. Only show the item when the selected asset actually has a scene node, and make the jump robust: switch to the Scene Hierarchy tab, select the node, expand its ancestors and scroll it into view (EnsureVisible), then focus the tree. Also read the selection from the virtual list's backing list instead of Items[]. Co-Authored-By: Clue Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Bug
Right-clicking a row in the Asset List and choosing Go to scene hierarchy did nothing.
Cause
The context item was made visible for every single selection, but only assets that belong to a GameObject carry a
TreeNode— Components, and the Mesh referenced by aMeshFilter/SkinnedMeshRenderer. For any other asset (textures, audio, text, standalone meshes, …)TreeNodeisnull, so the handler'sif (TreeNode != null)guard fell through and nothing happened. The item looked clickable but was a dead entry.Fix
TreeNode != null), so it's never a dead item.EnsureVisible()(expand ancestors + scroll into view), then focus the tree.visibleAssets[i]) instead ofassetListView.Items[i].Verified