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

Mesh should allow iterating over the stored MeshVertexAttributes #14365

Closed
SludgePhD opened this issue Jul 17, 2024 · 1 comment · Fixed by #14394
Closed

Mesh should allow iterating over the stored MeshVertexAttributes #14365

SludgePhD opened this issue Jul 17, 2024 · 1 comment · Fixed by #14394
Labels
A-Rendering Drawing game state to the screen C-Enhancement A new feature

Comments

@SludgePhD
Copy link
Contributor

What problem does this solve or what need does it fill?

Editors trying to inspect Meshes currently can only iterate over the contained MeshVertexAttributeIds, which don't contain enough information for a decent UI (eg. the attribute name is missing).

What solution would you like?

Mesh should allow iterating over the contained MeshVertexAttributes.

What alternative(s) have you considered?

A workaround is to hardcode a list of attributes to show in the editor.

@SludgePhD SludgePhD added C-Enhancement A new feature S-Needs-Triage This issue needs to be labelled labels Jul 17, 2024
@IceSentry
Copy link
Contributor

IceSentry commented Jul 17, 2024

One solution would be to update Mesh::attributes() to use Item = (MeshVertexAttributeId, &MeshAttributeData), but attributes_mut() shouldn't do that. So I think a better solution would be to add Mesh::atributes_data() with no _mut variant and it would return Item = (MeshVertexAttributeId, &MeshAttributeData)

@IceSentry IceSentry added A-Rendering Drawing game state to the screen and removed S-Needs-Triage This issue needs to be labelled labels Jul 17, 2024
github-merge-queue bot pushed a commit that referenced this issue Aug 12, 2024
…#14394)

# Objective

Fixes #14365 

## Migration Guide

- When using the iterator returned by `Mesh::attributes` or
`Mesh::attributes_mut` the first value of the tuple is not the
`MeshVertexAttribute` instead of `MeshVertexAttributeId`. To access the
`MeshVertexAttributeId` use the `MeshVertexAttribute.id` field.

Signed-off-by: Sarthak Singh <sarthak.singh99@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Enhancement A new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants