Skip to main content

cull_hidden

Function cull_hidden 

Source
pub fn cull_hidden(
    commands: Commands<'_, '_>,
    hidden: Res<'_, HiddenExtracts>,
    map: ResMut<'_, RenderEntityMap>,
)
Expand description

Prepare-stage guard that despawns every extracted render entity whose owning main entity is hidden (per HiddenExtracts), then drops those entries from RenderEntityMap so the next frame’s keyed upserts start clean. Runs before crate::node_ir::transform_extracted_to_nodes so no hidden leaf reaches the retained tree.

Belt-and-suspenders behind the per-extractor hidden_entities filters: with every current extractor filtering, this system finds nothing to do on the common path; it exists so a future extractor that forgets the filter still cannot paint a hidden subtree.