bevy-inspector-egui icon indicating copy to clipboard operation
bevy-inspector-egui copied to clipboard

Displaying only specific components in component inspector.

Open erikhoj opened this issue 1 year ago • 1 comments
trafficstars

Hello!

I used your egui_dock example to get a basic editor up and running. I'm trying to tailor it to my specific use-case. When displaying the UI for the selected entities, I use the following logic:

EguiWindow::Inspector => match *self.selection {
    InspectorSelection::Entities => match self.selected_entities.as_slice() {
        &[entity] => ui_for_entity_with_children(self.world, entity, ui),
        entities => ui_for_entities_shared_components(self.world, entities, ui),
    },
    ...
}

I want to filter the Components that are shown in the editor, so I only show specific component types that I have marked as visible. Currently it shows every single component on the Entity, even if they are not properly registered in the TypeRegistry. Is there some way that I can configure bevy_inspector to only show specific component types when calling the above functions?

image

erikhoj avatar Nov 16 '24 19:11 erikhoj

Hello! I want to filter the Components that are shown in the editor, so I only show specific component types that I have marked as visible.

I have a library I've been working on that uses this library as a backend to do that. https://github.com/rydb/bevy_ui_extras E.G, to visualize Transform in it:

visualize_components_for::<Transform>(bevy_ui_extras::Display::Side(Side::Right)),

I'm going to be updating it to 0.15 and bug-fixing it, hopefully sometime in the future, I could make a pr to merge single component displays into this library though!

rydb avatar Dec 02 '24 22:12 rydb