Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions UnityRiftGUI/UnityRiftGUIForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2110,7 +2110,11 @@ private void assetListView_MouseClick(object sender, MouseEventArgs e)

if (assetListView.SelectedIndices.Count == 1)
{
goToSceneHierarchyToolStripMenuItem.Visible = true;
// Only offer "Go to scene hierarchy" for assets that actually have a scene
// node (Components and the Mesh under a MeshFilter/SkinnedMeshRenderer);
// otherwise the item was shown but clicking it did nothing.
var single = visibleAssets[assetListView.SelectedIndices[0]];
goToSceneHierarchyToolStripMenuItem.Visible = single.TreeNode != null;
showOriginalFileToolStripMenuItem.Visible = true;
}
if (assetListView.SelectedIndices.Count >= 1)
Expand Down Expand Up @@ -2280,12 +2284,15 @@ private void ExportMergeObjects(bool animation)

private void goToSceneHierarchyToolStripMenuItem_Click(object sender, EventArgs e)
{
var selectAsset = (AssetItem)assetListView.Items[assetListView.SelectedIndices[0]];
if (selectAsset.TreeNode != null)
{
sceneTreeView.SelectedNode = selectAsset.TreeNode;
tabControl1.SelectedTab = tabPage1;
}
if (assetListView.SelectedIndices.Count == 0)
return;
var selectAsset = visibleAssets[assetListView.SelectedIndices[0]];
if (selectAsset.TreeNode == null)
return;
tabControl1.SelectedTab = tabPage1; // switch to the Scene Hierarchy tab first
sceneTreeView.SelectedNode = selectAsset.TreeNode;
selectAsset.TreeNode.EnsureVisible(); // expand ancestors and scroll into view
sceneTreeView.Focus();
}

private void exportAllAssetsMenuItem_Click(object sender, EventArgs e)
Expand Down
Loading