Skip to content

Commit b90d0f1

Browse files
committed
Merge branch 'master' of github.com:komadori/bevy_mod_outline into bevy-0.19
2 parents e3392e9 + 85b1fca commit b90d0f1

3 files changed

Lines changed: 33 additions & 4 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,12 @@
1111
### Changed
1212
- Updated Bevy dependency to 0.19.
1313

14+
## bevy_mod_outline 0.12.1 (2026-05-11)
15+
16+
## Changed
17+
- Fixed recursive AsyncSceneInheritOutline. (@Shatur)
18+
- Fixed panic in AutoGenerateOutlineNormalsPlugin with render-world only meshes.
19+
1420
## bevy_mod_outline 0.12.0 (2026-02-17)
1521

1622
### Removed

src/generate.rs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use bevy::{
2+
asset::RenderAssetUsages,
23
math::FloatOrd,
34
mesh::{Indices, VertexAttributeValues},
45
platform::collections::{HashMap, HashSet},
@@ -197,8 +198,10 @@ fn auto_generate_outline_normals(
197198
// Suppress modification events created by this system
198199
squelch.remove(id);
199200
} else if let Some(mut mesh) = meshes.get_mut(*id) {
200-
let _ = mesh.generate_outline_normals(&plugin.settings);
201-
squelch.insert(*id);
201+
if mesh.asset_usage.contains(RenderAssetUsages::MAIN_WORLD) {
202+
let _ = mesh.generate_outline_normals(&plugin.settings);
203+
squelch.insert(*id);
204+
}
202205
}
203206
}
204207
AssetEvent::Removed { id } => {

src/world_serialisation.rs

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,14 @@ fn add_outline(
4141
mut commands: Commands,
4242
mut query: Query<(&mut AsyncWorldInheritOutline, Option<&WorldInstance>)>,
4343
systems: Res<AsyncWorldInheritOutlineSystems>,
44-
world_spawner: Res<WorldInstanceSpawner>,
44+
world_spawner: Option<Res<WorldInstanceSpawner>>,
4545
) {
4646
let Ok((mut scene_outline, scene_instance)) = query.get_mut(*entity_input) else {
4747
return;
4848
};
4949
let mut ready = false;
50-
if let Some(scene_instance) = scene_instance {
50+
// Assume that this scene cannot be ready if the SceneSpawner is currently in use.
51+
if let (Some(scene_instance), Some(world_spawner)) = (scene_instance, world_spawner) {
5152
let iid = **scene_instance;
5253
if world_spawner.instance_is_ready(iid) {
5354
for child in world_spawner.iter_instance_entities(iid) {
@@ -240,4 +241,23 @@ mod tests {
240241
app.update();
241242
assert_counts(&mut app, 2, 0);
242243
}
244+
245+
#[test]
246+
fn test_add_when_scene_spawner_missing() {
247+
let (mut app, scene_entity) = setup();
248+
249+
let scene_spawner = app
250+
.world_mut()
251+
.remove_resource::<WorldInstanceSpawner>()
252+
.unwrap();
253+
app.world_mut()
254+
.get_entity_mut(scene_entity)
255+
.unwrap()
256+
.insert(AsyncWorldInheritOutline::default());
257+
app.world_mut().flush();
258+
app.world_mut().insert_resource(scene_spawner);
259+
260+
app.update();
261+
assert_counts(&mut app, 0, 2);
262+
}
243263
}

0 commit comments

Comments
 (0)