Skip to content

Add support for lists in bevy_proto_bsn parsing #204

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

Merged
merged 1 commit into from
Jun 6, 2025

Conversation

mmatvein
Copy link
Contributor

@mmatvein mmatvein commented Jun 6, 2025

Added support for deserializing for example into a Vec in a proto_bsn asset. I used the List term instead of Vec as it seemed to be used in bevy_reflect.

-- foo.rs
#[derive(Component, ...)]
#[reflect(...)]
pub struct Foo {
    pub values: Vec<f32>
}

-- foo.proto_bsn:
(
    Foo {
        values: [ 0.5, 1.2, 1.9, 2.6 ]
    }
)

NOTE: This does not yet add support for deserializing into arrays. That could be implemented by adding support for DynamicArray loading in reflect_list.

@jbuehler23
Copy link
Contributor

@villor when you have a chance :)

@jbuehler23 jbuehler23 added S-Needs-Review Needs reviewer attention (from anyone!) to move forward A-Assets Getting images, models and sounds into the editor labels Jun 6, 2025
@jbuehler23
Copy link
Contributor

same here as well, needs some help with clippy

Copy link
Contributor

@villor villor left a comment

Choose a reason for hiding this comment

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

Very useful addition. Code looks good to me.

Thank you!

@alice-i-cecile
Copy link
Member

@mmatvein ping us when CI is green and we'll get this merged :)

@alice-i-cecile alice-i-cecile enabled auto-merge June 6, 2025 23:08
@alice-i-cecile alice-i-cecile added this pull request to the merge queue Jun 6, 2025
Merged via the queue into bevyengine:main with commit 9b375fa Jun 6, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Assets Getting images, models and sounds into the editor S-Needs-Review Needs reviewer attention (from anyone!) to move forward
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants