Skip to content

Fix "Go to scene hierarchy" doing nothing on non-scene assets - #7

Merged
Diphome merged 1 commit into
masterfrom
fix/go-to-scene-hierarchy
Sep 7, 2026
Merged

Fix "Go to scene hierarchy" doing nothing on non-scene assets#7
Diphome merged 1 commit into
masterfrom
fix/go-to-scene-hierarchy

Conversation

@Diphome

@Diphome Diphome commented Sep 7, 2026

Copy link
Copy Markdown
Owner

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 a MeshFilter/SkinnedMeshRenderer. For any other asset (textures, audio, text, standalone meshes, …) TreeNode is null, so the handler's if (TreeNode != null) guard fell through and nothing happened. The item looked clickable but was a dead entry.

Fix

  • Only show Go to scene hierarchy when the selected asset actually has a scene node (TreeNode != null), so it's never a dead item.
  • Make the jump robust: switch to the Scene Hierarchy tab first, select the node, EnsureVisible() (expand ancestors + scroll into view), then focus the tree.
  • Read the selection from the virtual list's backing list (visibleAssets[i]) instead of assetListView.Items[i].

Verified

  • net9.0-windows build green. CI validates net472/net8/net9.
  • ⚠️ Not yet clicked through on a live project with a scene — if you load one, right-click a Transform/Component or a scene Mesh: the item should appear and jump+scroll to its node; on a texture/audio asset the item should now be hidden rather than dead.

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>
@Diphome
Diphome merged commit 470a7bd into master Sep 7, 2026
1 check passed
@Diphome
Diphome deleted the fix/go-to-scene-hierarchy branch September 7, 2026 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant