bevy icon indicating copy to clipboard operation
bevy copied to clipboard

Align `Scene::write_to_world_with` to match `DynamicScene::write_to_world_with`

Open dmyyy opened this issue 1 year ago • 5 comments

Objective

Fixes a regression in previously merged but then reverted pr that aligns lower-level Scene API with that in DynamicScene. Please look at the original pr for more details.

The problem was spawn_sync_internal is used in spawn_queued_scenes. Since instance creation was moved up a level we need to make sure we add a specific instance to SceneSpawner::spawned_instances when using spawn_sync_internal (just like we do for DynamicScene).

Please look at the last commit when reviewing.

Testing

alien_cake_addict and deferred_rendering examples look as expected.

Changelog

Changed Scene::write_to_world_with to take entity_map as an argument and no longer return an InstanceInfo

Migration Guide

Scene::write_to_world_with no longer returns an InstanceInfo.

Before

scene.write_to_world_with(world, &registry)

After

let mut entity_map = EntityHashMap::default();
scene.write_to_world_with(world, &mut entity_map, &registry)

dmyyy avatar Jun 15 '24 01:06 dmyyy

@alice-i-cecile Anything I can do on my end to move this pr along?

dmyyy avatar Jun 27 '24 20:06 dmyyy

Can you swap this to a more descriptive title and then post about this in #scenes-dev please?

alice-i-cecile avatar Jun 27 '24 20:06 alice-i-cecile

@NthTensor You approved the last version - do you have a chance to take a look at this updated one?

dmyyy avatar Jul 05 '24 03:07 dmyyy

~~@dmyyy I'd also recommend updating your PR description as parts of it are from #13714 and don't really have to do with this fix~~

Never mind, I didn't realize that PR was reverted and this is re-applying those commits.

MrGVSV avatar Jul 09 '24 19:07 MrGVSV

~@dmyyy I'd also recommend updating your PR description as parts of it are from #13714 and don't really have to do with this fix~

Never mind, I didn't realize that PR was reverted and this is re-applying those commits.

The description is a little bit confusing - I updated the wording a little

dmyyy avatar Jul 10 '24 00:07 dmyyy

I've double-checked the examples and no regressions this time :)

alice-i-cecile avatar Jul 15 '24 14:07 alice-i-cecile