Skip to main content

Module scene_tree

Module scene_tree 

Source
Expand description

Scene Tree panel โ€” the entity hierarchy: search, foldable rows with a chevron and a type icon, and the branded gold selection bar.

EditorState::hidden_entities still dims the rows it names, but nothing populates it: the visibility eye was removed because it only greyed the row while the object kept rendering. The set is left in place as the seam a component-activation model would plug into.

Structsยง

SceneTreePanel

Enumsยง

EditorAction ๐Ÿ”’

Constantsยง

HEADER_HEIGHT ๐Ÿ”’
ROW_HEIGHT ๐Ÿ”’
ROW_PAD_X ๐Ÿ”’
TOOLBAR_HEIGHT ๐Ÿ”’

Functionsยง

count_scene_nodes ๐Ÿ”’
Recursively counts every visible node in a subtree (self + children).
count_visible_nodes ๐Ÿ”’
Counts the rows a forest actually shows, stopping at folded nodes.
dispatch_asset_drop ๐Ÿ”’
Routes an asset dropped onto the hierarchy to the right pending_* action, mirroring the viewportโ€™s drop dispatch. Meshes spawn at the world origin (a tree has no 3D drop point), prefabs instantiate, scenes load, and a texture/material assigns to the target row (or the selection).
entity_icon ๐Ÿ”’
filter_scene_node ๐Ÿ”’
Filters a SceneNode against a lowercase needle. Returns Some(node) when the nodeโ€™s own name contains the needle (subtree kept intact) or when any descendant matches (only matching descendants kept). Returns None when neither the node nor any descendant matches.
find_node_name ๐Ÿ”’
Finds an entityโ€™s display name in a SceneNode forest.
pack_entity ๐Ÿ”’
Packs an EntityId into a u64 for drag-and-drop payloads. Layout: high 32 = generation, low 32 = index. Also used by the asset browserโ€™s drop handler to ingest entity drags from the scene tree (drop = create prefab in the current folder).
payload_is_entity ๐Ÿ”’
true when payload is not one of the asset-browserโ€™s dedicated drag tags (the type-agnostic asset-tile tag). Lets receivers disambiguate scene-tree entity payloads from asset-tile payloads on the same dnd_take_drop_payload channel.
render_node ๐Ÿ”’
unpack_entity ๐Ÿ”’
Inverse of pack_entity.