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

Bump Bevy to 0.15 #46

Merged
merged 5 commits into from
Dec 30, 2024
Merged

Bump Bevy to 0.15 #46

merged 5 commits into from
Dec 30, 2024

Conversation

shakesbeare
Copy link
Contributor

@shakesbeare shakesbeare commented Dec 25, 2024

Continuation of #44

Looks like the issue is that the new Mesh#d components require a MeshMaterial#d component to render their content. I added a few lines to svg_mesh_linker to update the handles in the default implementations for these components. Details

It looks like it works for both 2d and 3d examples.

Ray Redondo and others added 4 commits November 30, 2024 03:55
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.
@shakesbeare
Copy link
Contributor Author

shakesbeare commented Dec 25, 2024

It looks like there is some remaining issue with svg's updating. I think we need to update the materials in the AssetEvent::Modified match arm, but I'm not currently sure what needs to happen. I'm investigating it, now.

Edit: Looks like the examples do run correctly. It might be an issue in my project, but I don't remember this happening.

@shakesbeare
Copy link
Contributor Author

Fixed the issue. Everything should be in order, now. Sorry about that.

The issue was that the Material was only being updated when an AssetEvent occurred, but when spawning an entity who's SVG was already loaded, it wouldn't. Oddly, doing the same duplication of the Handle<Svg> in the AssetEvent::Modified match arm didn't work. I messed with a few other solutions but they either also didn't work or felt hacky (e.g. a system that runs every frame without needing to wait for AssetEvents).

New method does away with required components. I added an on_insert component hook for both Svg2d and Svg3d to ensure that the proper material is always added along with the main component without needing any system. This feels much more robust. All components are always added with the proper material every time.

Examples run and render, as well as my own project which originally detected the bug.

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.

Looks good. Thanks for doing this!

@Weasy666 Weasy666 merged commit c8ab332 into Weasy666:main Dec 30, 2024
This was referenced 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.

2 participants