Skip to main content

Module ops

Module ops 

Source
Expand description

Pure ECS operations used by the editor application.

StructsΒ§

NodeInfo πŸ”’
Display data for one entity, gathered in the first pass so the tree can be assembled top-down afterwards without touching the World again.

FunctionsΒ§

add_component_to_entity
Adds a new component to an existing entity by dispatching through the inventory registry.
apply_edits
Applies queued property edits back into ECS components.
build_scene_node πŸ”’
Builds the SceneNode for entity and, recursively, its children.
default_surface_material πŸ”’
Processes pending spawn requests from the scene tree panel. The material the editor attaches to a freshly-spawned primitive so it is immediately visible and editable. The engine projection has no implicit default material (a meshed entity without one is a clear, logged error), so the authoring tool supplies an explicit one β€” a neutral matte grey the user then tweaks in the inspector.
delete_selection
Deletes every currently selected entity and clears selection/inspector state.
domain_tag πŸ”’
Maps [SemanticDomain] to the small integer tag the editor side uses in [ComponentJson::domain]. Kept here so khora-core doesn’t have to know about khora-data’s domain enum β€” the inspector reads the tag and dispatches to category labels.
duplicate_entity
Duplicates an entity and everything below it.
extract_inspected
Extracts inspectable component snapshots for the single selected entity.
extract_scene_tree
Extracts a scene tree snapshot from the ECS world into editor state.
process_reparents
Drains state.pending_reparent and applies it to the ECS hierarchy.
process_spawns
spawn_mesh_asset
Spawns an entity that references a mesh asset by UUID at a world point, attaching a default surface material so it renders immediately. The asset_resolver_system loads the mesh from the MeshRef::Asset next tick. Returns the new entity. label is used to derive a readable Name.
sync_scene_cameras_for_mode
Keeps ECS scene-camera activation consistent with the current play mode.