bevy/release-content/migration-guides/rework_merge_mesh_error.md
Pnoenix f964ee1e3a
Expand MergeMeshError to include IncompatiblePrimitiveTopology variant (#18561)
# Objective

Fix #18546 by adding a variant to `MergeMeshError`, for incompatible
primitive topologies.

## Solution

Made `MergeMeshError` into an enum with two variants;
`IncompatibleVertexAttributes` and `IncompatiblePrimitiveTopology`.
Added an if statement in `Mesh::merge` to check if the
`primitive_topology` field of `self` matches `other`.
Also renamed `MergeMeshError` to `MeshMergeError` to align with the two
other `MeshSomethingError`'s.

## Testing

Didn't do any.
2025-07-16 20:37:58 +00:00

639 B

title pull_requests
Rework `MergeMeshError`
18561

MergeMeshError was reworked to account for the possibility of the meshes being merged having two different PrimitiveTopology's, and was renamed to MeshMergeError to align with the naming of other mesh errors.

  • Users will need to rename MergeMeshError to MeshMergeError
  • When handling MergeMeshError (now MeshMergeError), users will need to account for the new IncompatiblePrimitiveTopology variant, as it has been changed from a struct to an enum
  • Mesh::merge now returns Result<(), MeshMergeError> instead of the previous Result<(), MergeMeshError>