-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Mesh::merge to return a Result #17475
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some documentation nitpicks.
I feel like the names of the attributes
and attributes_data
accessors are now a bit surprising? But I guess that's outside the scope of this PR.
crates/bevy_mesh/src/mesh.rs
Outdated
/// For example, [`VertexAttributeValues::Float32`] is incompatible with [`VertexAttributeValues::Float32x3`]. | ||
/// | ||
/// In that case, [`self`] is not modified. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That doesn't seem true if I'm reading the code right? It could append some attributes but then error out on a later one?
Co-authored-by: Greeble <166992735+greeble-dev@users.noreply.github.com>
@Vrixyz ping me when this is ready and I'll get this in. |
I removed the wrong comment, thanks reviewers ; @alice-i-cecile here goes your requested ping.
Indeed. The new accessor is |
I've resolved merge conflicts for you but CI is 100% gonna gripe about that allow statement :) |
Co-authored-by: Benjamin Brienen <benjamin.brienen@outlook.com>
# Objective Make `Mesh::merge` more resilient to use. Currently, it's difficult to make sure `Mesh::merge` will not panic (we'd have to check if all attributes are compatible). - I'd appreciate it for utility function to convert different mesh representations such as: dimforge/bevy_rapier#628. ## Solution - Make `Mesh::merge` return a `Result`. ## Testing - It builds ## Migration Guide - `Mesh::merge` now returns a `Result<(), MeshMergeError>`. --------- Co-authored-by: Alice Cecile <alice.i.cecile@gmail.com> Co-authored-by: Greeble <166992735+greeble-dev@users.noreply.github.com> Co-authored-by: Benjamin Brienen <benjamin.brienen@outlook.com>
Objective
Make
Mesh::merge
more resilient to use.Currently, it's difficult to make sure
Mesh::merge
will not panic (we'd have to check if all attributes are compatible).Solution
Mesh::merge
return aResult
.Testing
Migration Guide
Mesh::merge
now returns aResult<(), MeshMergeError>
.