-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RenderLayers does not affect SceneBundle #5183
Comments
|
I see! It probably should though, right? In that sense I guess this is a feature request. |
Related to #838. This is effectively the same feature, but for render layers. |
Oh yeah! |
I would like to propose a similar pattern to |
Awful brute-force workaround for this issue. Add a #[derive(Component)]
struct PropagateRenderLayers;
fn propagate_render_layers_added(
mut cmds: Commands,
parents: Query<(&RenderLayers, &Children), (Added<PropagateRenderLayers>, With<Children>)>,
) {
for (render_layers, children) in &parents {
for child in children {
cmds.entity(*child)
.insert((PropagateRenderLayers, *render_layers));
}
}
}
fn propagate_render_layers_changed(
mut cmds: Commands,
parents: Query<
(&RenderLayers, &Children),
(
With<PropagateRenderLayers>,
With<Children>,
Changed<RenderLayers>,
),
>,
) {
for (render_layers, children) in &parents {
for child in children {
cmds.entity(*child)
.insert(*render_layers);
}
}
}
fn propagate_render_layers_add_child(
mut cmds: Commands,
parents: Query<(&RenderLayers, &Children), (With<PropagateRenderLayers>, Changed<Children>)>,
) {
for (render_layers, children) in &parents {
for child in children {
cmds.entity(*child)
.insert((PropagateRenderLayers, *render_layers));
}
}
} |
Or just use https://github.com/nicopap/bevy-scene-hook, which is much better than my workaround above |
Bevy version
Latest bevy git commit at time of writing,
8f721d8d0ac2e14a46051175f6d3394ed87c7214
.Relevant system information
What you did
I noticed this issue in my current project. I also tried adding the component
RenderLayers::layer(1)
to the SceneBundle in the split_screen example.What went wrong
The component has no effect.
The text was updated successfully, but these errors were encountered: