From f3eeeb31fbdd529adb58dc99d19959ddd6b6216a Mon Sep 17 00:00:00 2001 From: Trashtalk Date: Fri, 4 Oct 2024 19:12:00 +0200 Subject: [PATCH 1/6] deprecated get_or_spawn --- crates/bevy_core_pipeline/src/core_3d/mod.rs | 3 ++- crates/bevy_core_pipeline/src/dof/mod.rs | 4 +++- crates/bevy_ecs/src/system/commands/mod.rs | 2 ++ crates/bevy_ecs/src/world/mod.rs | 1 + crates/bevy_pbr/src/cluster/mod.rs | 6 ++++-- crates/bevy_pbr/src/light_probe/mod.rs | 9 ++++++--- crates/bevy_pbr/src/prepass/mod.rs | 3 ++- crates/bevy_pbr/src/render/light.rs | 4 +++- crates/bevy_ui/src/render/mod.rs | 3 ++- 9 files changed, 25 insertions(+), 10 deletions(-) diff --git a/crates/bevy_core_pipeline/src/core_3d/mod.rs b/crates/bevy_core_pipeline/src/core_3d/mod.rs index 71f1f031979d5..0c94bc6767e38 100644 --- a/crates/bevy_core_pipeline/src/core_3d/mod.rs +++ b/crates/bevy_core_pipeline/src/core_3d/mod.rs @@ -590,7 +590,8 @@ pub fn extract_camera_prepass_phase( live_entities.insert(entity); commands - .get_or_spawn(entity) + .get_entity(entity) + .expect("Camera entity wasn't synced.") .insert_if(DepthPrepass, || depth_prepass) .insert_if(NormalPrepass, || normal_prepass) .insert_if(MotionVectorPrepass, || motion_vector_prepass) diff --git a/crates/bevy_core_pipeline/src/dof/mod.rs b/crates/bevy_core_pipeline/src/dof/mod.rs index 100b7f20ffc4d..2494ae6e7b803 100644 --- a/crates/bevy_core_pipeline/src/dof/mod.rs +++ b/crates/bevy_core_pipeline/src/dof/mod.rs @@ -830,7 +830,9 @@ fn extract_depth_of_field_settings( calculate_focal_length(depth_of_field.sensor_height, perspective_projection.fov); // Convert `DepthOfField` to `DepthOfFieldUniform`. - commands.get_or_spawn(entity).insert(( + commands.get_entity(entity) + .expect("Depth of field entity wasn't synced.") + .insert(( *depth_of_field, DepthOfFieldUniform { focal_distance: depth_of_field.focal_distance, diff --git a/crates/bevy_ecs/src/system/commands/mod.rs b/crates/bevy_ecs/src/system/commands/mod.rs index bb40dd48a1c4c..00ba8f3b82ab7 100644 --- a/crates/bevy_ecs/src/system/commands/mod.rs +++ b/crates/bevy_ecs/src/system/commands/mod.rs @@ -325,8 +325,10 @@ impl<'w, 's> Commands<'w, 's> { /// [`Commands::spawn`]. This method should generally only be used for sharing entities across /// apps, and only when they have a scheme worked out to share an ID space (which doesn't happen /// by default). + #[deprecated(since = "0.15.0", note = "use Commands::spawn instead")] pub fn get_or_spawn(&mut self, entity: Entity) -> EntityCommands { self.queue(move |world: &mut World| { + #[allow(deprecated)] world.get_or_spawn(entity); }); EntityCommands { diff --git a/crates/bevy_ecs/src/world/mod.rs b/crates/bevy_ecs/src/world/mod.rs index 7dae46a97a857..cb0cf211f7832 100644 --- a/crates/bevy_ecs/src/world/mod.rs +++ b/crates/bevy_ecs/src/world/mod.rs @@ -780,6 +780,7 @@ impl World { /// This method should generally only be used for sharing entities across apps, and only when they have a /// scheme worked out to share an ID space (which doesn't happen by default). #[inline] + #[deprecated(since = "0.15.0", note = "use `World::spawn` instead")] pub fn get_or_spawn(&mut self, entity: Entity) -> Option { self.flush(); match self.entities.alloc_at_without_replacement(entity) { diff --git a/crates/bevy_pbr/src/cluster/mod.rs b/crates/bevy_pbr/src/cluster/mod.rs index 9c77a02149fc3..321c6c1ac842e 100644 --- a/crates/bevy_pbr/src/cluster/mod.rs +++ b/crates/bevy_pbr/src/cluster/mod.rs @@ -554,7 +554,9 @@ pub fn extract_clusters( } } - commands.get_or_spawn(entity.id()).insert(( + commands.get_entity(entity.id()) + .expect("Clusters entity wasn't synced.") + .insert(( ExtractedClusterableObjects { data }, ExtractedClusterConfig { near: clusters.near, @@ -617,7 +619,7 @@ pub fn prepare_clusters( view_clusters_bindings.write_buffers(render_device, &render_queue); - commands.get_or_spawn(entity).insert(view_clusters_bindings); + commands.entity(entity).insert(view_clusters_bindings); } } diff --git a/crates/bevy_pbr/src/light_probe/mod.rs b/crates/bevy_pbr/src/light_probe/mod.rs index eb1b4ccec4f91..2bfd2408a9fe4 100644 --- a/crates/bevy_pbr/src/light_probe/mod.rs +++ b/crates/bevy_pbr/src/light_probe/mod.rs @@ -386,7 +386,8 @@ fn gather_environment_map_uniform( EnvironmentMapUniform::default() }; commands - .get_or_spawn(view_entity.id()) + .get_entity(view_entity.id()) + .expect("Environment map light entity wasn't synced.") .insert(environment_map_uniform); } } @@ -440,11 +441,13 @@ fn gather_light_probes( // Record the per-view light probes. if render_view_light_probes.is_empty() { commands - .get_or_spawn(entity) + .get_entity(entity) + .expect("View entity wasn't synced.") .remove::>(); } else { commands - .get_or_spawn(entity) + .get_entity(entity) + .expect("View entity wasn't synced.") .insert(render_view_light_probes); } } diff --git a/crates/bevy_pbr/src/prepass/mod.rs b/crates/bevy_pbr/src/prepass/mod.rs index 6aaeed96787eb..789245265919f 100644 --- a/crates/bevy_pbr/src/prepass/mod.rs +++ b/crates/bevy_pbr/src/prepass/mod.rs @@ -585,7 +585,8 @@ pub fn extract_camera_previous_view_data( for (entity, camera, maybe_previous_view_data) in cameras_3d.iter() { if camera.is_active { let entity = entity.id(); - let mut entity = commands.get_or_spawn(entity); + let mut entity = + commands.get_entity(entity).expect("Camera entity wasn't synced."); if let Some(previous_view_data) = maybe_previous_view_data { entity.insert(previous_view_data.clone()); diff --git a/crates/bevy_pbr/src/render/light.rs b/crates/bevy_pbr/src/render/light.rs index ea0bfd25e7aed..dd790957fb7b2 100644 --- a/crates/bevy_pbr/src/render/light.rs +++ b/crates/bevy_pbr/src/render/light.rs @@ -403,7 +403,9 @@ pub fn extract_lights( } } - commands.get_or_spawn(entity.id()).insert(( + commands.get_entity(entity.id()) + .expect("Light entity wasn't synced.") + .insert(( ExtractedDirectionalLight { color: directional_light.color.into(), illuminance: directional_light.illuminance, diff --git a/crates/bevy_ui/src/render/mod.rs b/crates/bevy_ui/src/render/mod.rs index d8c9948d22a7b..f0554d1b97cf0 100644 --- a/crates/bevy_ui/src/render/mod.rs +++ b/crates/bevy_ui/src/render/mod.rs @@ -510,7 +510,8 @@ pub fn extract_default_ui_camera_view( TemporaryRenderEntity, )) .id(); - let mut entity_commands = commands.get_or_spawn(entity); + let mut entity_commands = + commands.get_entity(entity).expect("Camera entity wasn't synced."); entity_commands.insert(DefaultCameraView(default_camera_view)); if let Some(ui_anti_alias) = ui_anti_alias { entity_commands.insert(*ui_anti_alias); From 6f047a71c677cdbbe3303ac3cdd76db49ac134ff Mon Sep 17 00:00:00 2001 From: Trashtalk Date: Fri, 4 Oct 2024 19:21:45 +0200 Subject: [PATCH 2/6] cargo fmt --- crates/bevy_core_pipeline/src/dof/mod.rs | 34 +++++++++-------- crates/bevy_pbr/src/cluster/mod.rs | 21 ++++++----- crates/bevy_pbr/src/prepass/mod.rs | 5 ++- crates/bevy_pbr/src/render/light.rs | 47 ++++++++++++------------ crates/bevy_ui/src/render/mod.rs | 5 ++- 5 files changed, 59 insertions(+), 53 deletions(-) diff --git a/crates/bevy_core_pipeline/src/dof/mod.rs b/crates/bevy_core_pipeline/src/dof/mod.rs index 2494ae6e7b803..76087b63a69bd 100644 --- a/crates/bevy_core_pipeline/src/dof/mod.rs +++ b/crates/bevy_core_pipeline/src/dof/mod.rs @@ -830,22 +830,24 @@ fn extract_depth_of_field_settings( calculate_focal_length(depth_of_field.sensor_height, perspective_projection.fov); // Convert `DepthOfField` to `DepthOfFieldUniform`. - commands.get_entity(entity) - .expect("Depth of field entity wasn't synced.") - .insert(( - *depth_of_field, - DepthOfFieldUniform { - focal_distance: depth_of_field.focal_distance, - focal_length, - coc_scale_factor: focal_length * focal_length - / (depth_of_field.sensor_height * depth_of_field.aperture_f_stops), - max_circle_of_confusion_diameter: depth_of_field.max_circle_of_confusion_diameter, - max_depth: depth_of_field.max_depth, - pad_a: 0, - pad_b: 0, - pad_c: 0, - }, - )); + commands + .get_entity(entity) + .expect("Depth of field entity wasn't synced.") + .insert(( + *depth_of_field, + DepthOfFieldUniform { + focal_distance: depth_of_field.focal_distance, + focal_length, + coc_scale_factor: focal_length * focal_length + / (depth_of_field.sensor_height * depth_of_field.aperture_f_stops), + max_circle_of_confusion_diameter: depth_of_field + .max_circle_of_confusion_diameter, + max_depth: depth_of_field.max_depth, + pad_a: 0, + pad_b: 0, + pad_c: 0, + }, + )); } } diff --git a/crates/bevy_pbr/src/cluster/mod.rs b/crates/bevy_pbr/src/cluster/mod.rs index 321c6c1ac842e..375861e294907 100644 --- a/crates/bevy_pbr/src/cluster/mod.rs +++ b/crates/bevy_pbr/src/cluster/mod.rs @@ -554,16 +554,17 @@ pub fn extract_clusters( } } - commands.get_entity(entity.id()) - .expect("Clusters entity wasn't synced.") - .insert(( - ExtractedClusterableObjects { data }, - ExtractedClusterConfig { - near: clusters.near, - far: clusters.far, - dimensions: clusters.dimensions, - }, - )); + commands + .get_entity(entity.id()) + .expect("Clusters entity wasn't synced.") + .insert(( + ExtractedClusterableObjects { data }, + ExtractedClusterConfig { + near: clusters.near, + far: clusters.far, + dimensions: clusters.dimensions, + }, + )); } } diff --git a/crates/bevy_pbr/src/prepass/mod.rs b/crates/bevy_pbr/src/prepass/mod.rs index 789245265919f..dc4bb77be1325 100644 --- a/crates/bevy_pbr/src/prepass/mod.rs +++ b/crates/bevy_pbr/src/prepass/mod.rs @@ -585,8 +585,9 @@ pub fn extract_camera_previous_view_data( for (entity, camera, maybe_previous_view_data) in cameras_3d.iter() { if camera.is_active { let entity = entity.id(); - let mut entity = - commands.get_entity(entity).expect("Camera entity wasn't synced."); + let mut entity = commands + .get_entity(entity) + .expect("Camera entity wasn't synced."); if let Some(previous_view_data) = maybe_previous_view_data { entity.insert(previous_view_data.clone()); diff --git a/crates/bevy_pbr/src/render/light.rs b/crates/bevy_pbr/src/render/light.rs index dd790957fb7b2..584c6f4fef433 100644 --- a/crates/bevy_pbr/src/render/light.rs +++ b/crates/bevy_pbr/src/render/light.rs @@ -403,29 +403,30 @@ pub fn extract_lights( } } - commands.get_entity(entity.id()) - .expect("Light entity wasn't synced.") - .insert(( - ExtractedDirectionalLight { - color: directional_light.color.into(), - illuminance: directional_light.illuminance, - transform: *transform, - volumetric: volumetric_light.is_some(), - soft_shadow_size: directional_light.soft_shadow_size, - shadows_enabled: directional_light.shadows_enabled, - shadow_depth_bias: directional_light.shadow_depth_bias, - // The factor of SQRT_2 is for the worst-case diagonal offset - shadow_normal_bias: directional_light.shadow_normal_bias - * core::f32::consts::SQRT_2, - cascade_shadow_config: cascade_config.clone(), - cascades: extracted_cascades, - frusta: extracted_frusta, - render_layers: maybe_layers.unwrap_or_default().clone(), - }, - CascadesVisibleEntities { - entities: cascade_visible_entities, - }, - )); + commands + .get_entity(entity.id()) + .expect("Light entity wasn't synced.") + .insert(( + ExtractedDirectionalLight { + color: directional_light.color.into(), + illuminance: directional_light.illuminance, + transform: *transform, + volumetric: volumetric_light.is_some(), + soft_shadow_size: directional_light.soft_shadow_size, + shadows_enabled: directional_light.shadows_enabled, + shadow_depth_bias: directional_light.shadow_depth_bias, + // The factor of SQRT_2 is for the worst-case diagonal offset + shadow_normal_bias: directional_light.shadow_normal_bias + * core::f32::consts::SQRT_2, + cascade_shadow_config: cascade_config.clone(), + cascades: extracted_cascades, + frusta: extracted_frusta, + render_layers: maybe_layers.unwrap_or_default().clone(), + }, + CascadesVisibleEntities { + entities: cascade_visible_entities, + }, + )); } } diff --git a/crates/bevy_ui/src/render/mod.rs b/crates/bevy_ui/src/render/mod.rs index f0554d1b97cf0..c136afdaa8af5 100644 --- a/crates/bevy_ui/src/render/mod.rs +++ b/crates/bevy_ui/src/render/mod.rs @@ -510,8 +510,9 @@ pub fn extract_default_ui_camera_view( TemporaryRenderEntity, )) .id(); - let mut entity_commands = - commands.get_entity(entity).expect("Camera entity wasn't synced."); + let mut entity_commands = commands + .get_entity(entity) + .expect("Camera entity wasn't synced."); entity_commands.insert(DefaultCameraView(default_camera_view)); if let Some(ui_anti_alias) = ui_anti_alias { entity_commands.insert(*ui_anti_alias); From 230e7b3bc395a4a9e39cc40d98ee30d15d8eeb0c Mon Sep 17 00:00:00 2001 From: Trashtalk Date: Sun, 6 Oct 2024 00:51:53 +0200 Subject: [PATCH 3/6] removed more mentions of get_or_spawn --- benches/benches/bevy_ecs/world/commands.rs | 38 ------- benches/benches/bevy_ecs/world/mod.rs | 1 - crates/bevy_core_pipeline/src/taa/mod.rs | 3 +- crates/bevy_ecs/src/lib.rs | 101 ------------------- crates/bevy_pbr/src/ssao/mod.rs | 3 +- crates/bevy_pbr/src/volumetric_fog/render.rs | 13 ++- crates/bevy_render/src/extract_param.rs | 5 +- 7 files changed, 17 insertions(+), 147 deletions(-) diff --git a/benches/benches/bevy_ecs/world/commands.rs b/benches/benches/bevy_ecs/world/commands.rs index 19128f80ba7da..e7e0483bc8a8f 100644 --- a/benches/benches/bevy_ecs/world/commands.rs +++ b/benches/benches/bevy_ecs/world/commands.rs @@ -209,41 +209,3 @@ pub fn medium_sized_commands(criterion: &mut Criterion) { pub fn large_sized_commands(criterion: &mut Criterion) { sized_commands_impl::>(criterion); } - -pub fn get_or_spawn(criterion: &mut Criterion) { - let mut group = criterion.benchmark_group("get_or_spawn"); - group.warm_up_time(core::time::Duration::from_millis(500)); - group.measurement_time(core::time::Duration::from_secs(4)); - - group.bench_function("individual", |bencher| { - let mut world = World::default(); - let mut command_queue = CommandQueue::default(); - - bencher.iter(|| { - let mut commands = Commands::new(&mut command_queue, &world); - for i in 0..10_000 { - commands - .get_or_spawn(Entity::from_raw(i)) - .insert((Matrix::default(), Vec3::default())); - } - command_queue.apply(&mut world); - }); - }); - - group.bench_function("batched", |bencher| { - let mut world = World::default(); - let mut command_queue = CommandQueue::default(); - - bencher.iter(|| { - let mut commands = Commands::new(&mut command_queue, &world); - let mut values = Vec::with_capacity(10_000); - for i in 0..10_000 { - values.push((Entity::from_raw(i), (Matrix::default(), Vec3::default()))); - } - commands.insert_or_spawn_batch(values); - command_queue.apply(&mut world); - }); - }); - - group.finish(); -} diff --git a/benches/benches/bevy_ecs/world/mod.rs b/benches/benches/bevy_ecs/world/mod.rs index 8af5e399018a1..a88f034776852 100644 --- a/benches/benches/bevy_ecs/world/mod.rs +++ b/benches/benches/bevy_ecs/world/mod.rs @@ -27,7 +27,6 @@ criterion_group!( zero_sized_commands, medium_sized_commands, large_sized_commands, - get_or_spawn, world_entity, world_get, world_query_get, diff --git a/crates/bevy_core_pipeline/src/taa/mod.rs b/crates/bevy_core_pipeline/src/taa/mod.rs index f3895d1e26241..d5b66a51b8d3c 100644 --- a/crates/bevy_core_pipeline/src/taa/mod.rs +++ b/crates/bevy_core_pipeline/src/taa/mod.rs @@ -375,7 +375,8 @@ fn extract_taa_settings(mut commands: Commands, mut main_world: ResMut, Changed)>]); } - #[test] - fn reserve_entities_across_worlds() { - let mut world_a = World::default(); - let mut world_b = World::default(); - - let e1 = world_a.spawn(A(1)).id(); - let e2 = world_a.spawn(A(2)).id(); - let e3 = world_a.entities().reserve_entity(); - world_a.flush_entities(); - - let world_a_max_entities = world_a.entities().len(); - world_b.entities.reserve_entities(world_a_max_entities); - world_b.entities.flush_as_invalid(); - - let e4 = world_b.spawn(A(4)).id(); - assert_eq!( - e4, - Entity::from_raw(3), - "new entity is created immediately after world_a's max entity" - ); - assert!(world_b.get::(e1).is_none()); - assert!(world_b.get_entity(e1).is_none()); - - assert!(world_b.get::(e2).is_none()); - assert!(world_b.get_entity(e2).is_none()); - - assert!(world_b.get::(e3).is_none()); - assert!(world_b.get_entity(e3).is_none()); - - world_b.get_or_spawn(e1).unwrap().insert(B(1)); - assert_eq!( - world_b.get::(e1), - Some(&B(1)), - "spawning into 'world_a' entities works" - ); - - world_b.get_or_spawn(e4).unwrap().insert(B(4)); - assert_eq!( - world_b.get::(e4), - Some(&B(4)), - "spawning into existing `world_b` entities works" - ); - assert_eq!( - world_b.get::(e4), - Some(&A(4)), - "spawning into existing `world_b` entities works" - ); - - let e4_mismatched_generation = - Entity::from_raw_and_generation(3, NonZero::::new(2).unwrap()); - assert!( - world_b.get_or_spawn(e4_mismatched_generation).is_none(), - "attempting to spawn on top of an entity with a mismatched entity generation fails" - ); - assert_eq!( - world_b.get::(e4), - Some(&B(4)), - "failed mismatched spawn doesn't change existing entity" - ); - assert_eq!( - world_b.get::(e4), - Some(&A(4)), - "failed mismatched spawn doesn't change existing entity" - ); - - let high_non_existent_entity = Entity::from_raw(6); - world_b - .get_or_spawn(high_non_existent_entity) - .unwrap() - .insert(B(10)); - assert_eq!( - world_b.get::(high_non_existent_entity), - Some(&B(10)), - "inserting into newly allocated high / non-continuous entity id works" - ); - - let high_non_existent_but_reserved_entity = Entity::from_raw(5); - assert!( - world_b.get_entity(high_non_existent_but_reserved_entity).is_none(), - "entities between high-newly allocated entity and continuous block of existing entities don't exist" - ); - - let reserved_entities = vec![ - world_b.entities().reserve_entity(), - world_b.entities().reserve_entity(), - world_b.entities().reserve_entity(), - world_b.entities().reserve_entity(), - ]; - - assert_eq!( - reserved_entities, - vec![ - Entity::from_raw(5), - Entity::from_raw(4), - Entity::from_raw(7), - Entity::from_raw(8), - ], - "space between original entities and high entities is used for new entity ids" - ); - } - #[test] fn insert_or_spawn_batch() { let mut world = World::default(); diff --git a/crates/bevy_pbr/src/ssao/mod.rs b/crates/bevy_pbr/src/ssao/mod.rs index a37fb9c79985d..b81a013d65f33 100644 --- a/crates/bevy_pbr/src/ssao/mod.rs +++ b/crates/bevy_pbr/src/ssao/mod.rs @@ -537,7 +537,8 @@ fn extract_ssao_settings( } if camera.is_active { commands - .get_or_spawn(entity.id()) + .get_entity(entity.id()) + .expect("SSAO entity wasn't synced.") .insert(ssao_settings.clone()); } } diff --git a/crates/bevy_pbr/src/volumetric_fog/render.rs b/crates/bevy_pbr/src/volumetric_fog/render.rs index b833197d4ac99..ae1e0e7f81bc3 100644 --- a/crates/bevy_pbr/src/volumetric_fog/render.rs +++ b/crates/bevy_pbr/src/volumetric_fog/render.rs @@ -280,18 +280,25 @@ pub fn extract_volumetric_fog( } for (entity, volumetric_fog) in view_targets.iter() { - commands.get_or_spawn(entity.id()).insert(*volumetric_fog); + commands + .get_entity(entity.id()) + .expect("Volumetric fog entity wasn't synced.") + .insert(*volumetric_fog); } for (entity, fog_volume, fog_transform) in fog_volumes.iter() { commands - .get_or_spawn(entity.id()) + .get_entity(entity.id()) + .expect("Fog volume entity wasn't synced.") .insert((*fog_volume).clone()) .insert(*fog_transform); } for (entity, volumetric_light) in volumetric_lights.iter() { - commands.get_or_spawn(entity.id()).insert(*volumetric_light); + commands + .get_entity(entity.id()) + .expect("Volumetric light entity wasn't synced.") + .insert(*volumetric_light); } } diff --git a/crates/bevy_render/src/extract_param.rs b/crates/bevy_render/src/extract_param.rs index 89b6edef1903d..1c323f86fbf09 100644 --- a/crates/bevy_render/src/extract_param.rs +++ b/crates/bevy_render/src/extract_param.rs @@ -31,10 +31,11 @@ use core::ops::{Deref, DerefMut}; /// use bevy_ecs::prelude::*; /// use bevy_render::Extract; /// # #[derive(Component)] +/// // Do make sure to sync the cloud entities before extracting them. /// # struct Cloud; -/// fn extract_clouds(mut commands: Commands, clouds: Extract>>) { +/// fn extract_clouds(mut commands: Commands, clouds: Extract>>) { /// for cloud in &clouds { -/// commands.get_or_spawn(cloud).insert(Cloud); +/// commands.entity(cloud.id()).insert(Cloud); /// } /// } /// ``` From bf5ffc08938fd6a885d914e2bf0550cee1a470ba Mon Sep 17 00:00:00 2001 From: Trashtalk Date: Sun, 6 Oct 2024 01:18:10 +0200 Subject: [PATCH 4/6] fixed an example --- examples/stress_tests/transform_hierarchy.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/stress_tests/transform_hierarchy.rs b/examples/stress_tests/transform_hierarchy.rs index 229b70a874080..2fd8c8f5bbf1c 100644 --- a/examples/stress_tests/transform_hierarchy.rs +++ b/examples/stress_tests/transform_hierarchy.rs @@ -432,7 +432,7 @@ fn spawn_tree( }; commands - .get_or_spawn(ents[parent_idx]) + .entity(ents[parent_idx]) .add_child(child_entity); ents.push(child_entity); From 0c9a78cc58add653bef606b002bcf8bc407df51e Mon Sep 17 00:00:00 2001 From: Trashtalk Date: Sun, 6 Oct 2024 01:21:18 +0200 Subject: [PATCH 5/6] cargo fmt --- examples/stress_tests/transform_hierarchy.rs | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/examples/stress_tests/transform_hierarchy.rs b/examples/stress_tests/transform_hierarchy.rs index 2fd8c8f5bbf1c..6e8c5f702743f 100644 --- a/examples/stress_tests/transform_hierarchy.rs +++ b/examples/stress_tests/transform_hierarchy.rs @@ -431,9 +431,7 @@ fn spawn_tree( cmd.id() }; - commands - .entity(ents[parent_idx]) - .add_child(child_entity); + commands.entity(ents[parent_idx]).add_child(child_entity); ents.push(child_entity); } From aea4564b9c3464590a9096cf7ab85c35ebf2f9ca Mon Sep 17 00:00:00 2001 From: Trashtalk Date: Sun, 6 Oct 2024 01:38:23 +0200 Subject: [PATCH 6/6] fix doc --- crates/bevy_render/src/extract_param.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/crates/bevy_render/src/extract_param.rs b/crates/bevy_render/src/extract_param.rs index 1c323f86fbf09..801a6b2d1c20d 100644 --- a/crates/bevy_render/src/extract_param.rs +++ b/crates/bevy_render/src/extract_param.rs @@ -30,6 +30,7 @@ use core::ops::{Deref, DerefMut}; /// ``` /// use bevy_ecs::prelude::*; /// use bevy_render::Extract; +/// use bevy_render::world_sync::RenderEntity; /// # #[derive(Component)] /// // Do make sure to sync the cloud entities before extracting them. /// # struct Cloud;