Vixen
02b45cc4
csharp
public sealed class SceneHierarchyView

A scene's entities as a tree: what is in it, what is selected, and what things are called.

No guide page documents this yet — the page shows what the code says about itself.

Remarks

The half of doc 11's scene editor that is not a viewport. A scene editor is "scene view + hierarchy + inspector"; the viewport is Vixen.Editor.SceneView's and the inspector is Vixen.Editor.Inspector's, and this is the third — written once, so that the scene editor and the prefab editor are one tree over two documents.

A class over a TreeView rather than a control deriving from one, on ProjectBrowser's terms and because TreeView is sealed. What is here is genuinely a binding: rows, selection, renames, and when to rebuild.

⚠ Rebuilt from StructureChanged, not polled. The document raises it when entities appear, disappear or change parent, and deliberately does not raise it for a transform edit or a rename — a tree rebuilt on every frame of a gizmo drag would lose its expansion state forty times a second. A rename moves one row's text instead.

⚠ Selection travels out of this and not into it. Clicking a row writes SceneDocument.Selection; something else selecting an entity does not move the highlight, because nothing here subscribes to the signal. That is the same gap the application's own hierarchy has, and the fix is the same Effect that needs a reactive scheduler the editor's loop does not flush.

Fields and properties (3)

  • public TreeView Tree

    The rows.

  • public SceneDocument Scene

    The scene being shown.

  • public int RootCount

    How many rows are at the top level.

Methods (3)

  • public SceneHierarchyView(SceneDocument scene, UiElement panel)

    Binds a tree to a scene, inside a container.

  • public void Detach()

    Stops listening to the document.

  • public void Rebuild()

    Rebuilds the rows from the document as it stands.

Used by (2)

  • PrefabViewVixen.Editor.AssetEditors
  • SceneEditorFactoryVixen.Editor.AssetEditors