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

Update to bevy 0.15 #44

Closed
wants to merge 3 commits into from
Closed

Update to bevy 0.15 #44

wants to merge 3 commits into from

Conversation

rdrpenguin04
Copy link
Contributor

@rdrpenguin04 rdrpenguin04 commented Nov 30, 2024

Closes #45.

The main thing I had to adjust is the way Handles are represented within Components (since they themselves are no longer components as of 0.15); while I was there, I deprecated the Bundles and added Component dependencies (#[require()]).

IN PROGRESS NOTE: All the compile errors have been removed, but nothing is rendering still. I'm wondering if it has anything to do with Bevy changing how Materials work in 0.15; I haven't fully diagnosed what to change though. If anyone would like to help with debugging this, let me know; this is a very foreign codebase to me, so while I think I did everything right to migrate correctly, it's possible I missed something.

I think the library is ready now, I just need to go through the examples and update them to the new component structure. The main thing I had to adjust is the way Handles are represented in components; while I was there, I deprecated the Bundles and added Component dependencies.
Copy link
Owner

@Weasy666 Weasy666 left a comment

Choose a reason for hiding this comment

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

Thanks for tackling this. I took a quick look what's done until now, and it looks pretty much fine for me.
I'm a bit out of the Bevy loop right now, so i'm not exactly sure what could be the problem here. The only thing coming to my mind, while looking at the Bevy release post, is the change from the immediate render world to the retained one. Maybe we're breaking the link between the main world and render world entities in svg_mesh_linker by only replacing the mesh and not also updating the link.
I don't know how the MainEntity component and RenderEntity component are synced via SyncToRenderWorld, but my guess is, that we are breaking it when we replace the Svg entity required component Mesh with the asset Mesh that was loaded with the asset loader.

#[cfg(all(feature = "2d", feature = "3d"))]
type WithMesh = Or<(With<Mesh2dHandle>, With<Handle<Mesh>>)>;
type WithMesh = Or<(With<Mesh2d>, With<Mesh3d>)>;

/// Checkes if a "new" SVG bundle was added by looking for a missing `OriginState`
/// and then adds it to the entity.
pub fn add_origin_state(
Copy link
Owner

Choose a reason for hiding this comment

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

I think, we need this only for backwards compatibility with Bundles and not anymore for the new required components approach, which should automatically add the default Origin. So let's at least leave a //INFO:, or something like that here to remind us to remove this later on.

@rdrpenguin04
Copy link
Contributor Author

I unfortunately don't know what I'm doing past this point; if anyone else wants to contribute to fix up what's left, go for it.

@shakesbeare shakesbeare mentioned this pull request Dec 25, 2024
@Weasy666
Copy link
Owner

Was picked up and merged in #46

@Weasy666 Weasy666 closed this Dec 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support for Bevy 0.15
2 participants