Skip to content
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

Align Scene::write_to_world_with to match DynamicScene::write_to_world_with #13855

Open
wants to merge 8 commits into
base: main
Choose a base branch
from

Conversation

dmyyy
Copy link
Contributor

@dmyyy dmyyy commented Jun 15, 2024

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)

@janhohenheim janhohenheim added C-Regression Functionality that used to work but no longer does. Add a test for this! A-Scenes Serialized ECS data stored on the disk S-Needs-Review Needs reviewer attention (from anyone!) to move forward C-Bug An unexpected or incorrect behavior and removed C-Regression Functionality that used to work but no longer does. Add a test for this! labels Jun 17, 2024
@BD103 BD103 added the C-Regression Functionality that used to work but no longer does. Add a test for this! label Jun 18, 2024
@dmyyy
Copy link
Contributor Author

dmyyy commented Jun 27, 2024

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

@alice-i-cecile
Copy link
Member

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

@alice-i-cecile alice-i-cecile added this to the 0.15 milestone Jun 27, 2024
@dmyyy dmyyy changed the title Fix regression in #13714 Align Scene::write_to_world_with to match DynamicScene::write_to_world_with Jun 27, 2024
@dmyyy
Copy link
Contributor Author

dmyyy commented Jul 5, 2024

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

Copy link
Member

@MrGVSV MrGVSV left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not too familiar with this part of the scene stuff but I think the change makes sense. It also seems to be in line with the call to Self::spawn_dynamic_internal a few lines up.

The alien_cake_addict example also seems to work properly again.

@MrGVSV
Copy link
Member

MrGVSV commented Jul 9, 2024

@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.

@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Jul 9, 2024
@dmyyy
Copy link
Contributor Author

dmyyy commented Jul 10, 2024

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Scenes Serialized ECS data stored on the disk C-Bug An unexpected or incorrect behavior C-Regression Functionality that used to work but no longer does. Add a test for this! S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants