Skip to content

Improving docs for Named Entity References (the #MyName inside bsn) - #26146

Closed
erickpiva wants to merge 7 commits into
bevyengine:mainfrom
erickpiva:main
Closed

erickpiva wants to merge 7 commits into
bevyengine:mainfrom
erickpiva:main

Conversation

@erickpiva

Copy link
Copy Markdown

Objective

Improve clarity around Named Entity References, how to pass the EntityTemplate around and storing the entity in a Component

Solution

  • Expand the docs about Named Entity Reference in bevy_scene docs, making the text clearer,
  • Add examples about the EntityTemplate generated, how to pass it to functions and how to store the entity generated in a component
  • Include a few of these concepts in the scene/bsn.rs example.

Testing

  • Generate the docs locally and visually checked the result.
  • Compile and run the bsn examples with no error and no warnings.

Updates the bsn example to show how a EntityTemplate can be passed
around functions and store in a component for later use
Clearing up the text in the "Named Entity Reference" section in
bevy_scene docs and adding a few more examples on how this can be used
@github-actions

Copy link
Copy Markdown
Contributor

Welcome, new contributor!

Please make sure you've read our contributing guide, as well as our policy regarding AI usage, and we look forward to reviewing your pull request shortly ✨

calinrus-dev and others added 4 commits October 12, 2026 20:01
Fixes bevyengine#18018.

`Option<T>` provides `Default` in Rust regardless of whether `T`
implements `Default`, but Bevy wasn't registering `ReflectDefault`. This
PR adds `#[reflect(Default)]` to `Option<T>`.

AI assistance: Codex (investigation, implementation, testing, and
copyediting of this description).

---------

Co-authored-by: François Mockers <francois.mockers@vleue.com>
bevyengine#26090)

…st's

# Objective

- Fixes bevyengine#26087 
- Bevy keeps a GPU buffer of per-mesh dataa (MeshUniform). The shader
expects each entry to be 176 bytes. Bevy worked out each entry's size by
asking Rust how big the struct is, not how big the shader says it is.
Normally both answers are 176, but w/ glam's scalar-math feature on,
Rust packs the struct tighter, to 168 bytes. If a render phase draws
exactly one mesh, the buffer comes out 168 bytes when the shader needs
at least 176, and wgpu throws the binding-size error. With two or more
meshes the buffer happens to be big enough, so the bug stays hidden.

## Solution

- UninitBufferVec now uses the shader's size for each entry instead of
Rust's (one line change boi)

## Testing

- A unit test with a struct that's 12 bytes in Rust but 16 in a shader.
It fails before the fix and passes after.
@jgayfer jgayfer added A-Scenes Composing and serializing ECS objects S-Needs-Review Needs reviewer attention (from anyone!) to move forward D-Straightforward Simple bug fixes and API improvements, docs, test and examples labels Oct 13, 2026

@mnmaita mnmaita left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Doc changes look great and I like you showcased passing Entity templates to functions! Take a look at some of the comments I left, thanks!

Comment thread crates/bevy_scene/src/lib.rs
Comment thread examples/scene/bsn.rs Outdated
Comment thread examples/scene/bsn.rs Outdated
Comment thread crates/bevy_reflect/src/impls/core/option.rs
Comment thread crates/bevy_render/src/render_resource/buffer_vec.rs
Co-authored-by: Martín Maita <47983254+mnmaita@users.noreply.github.com>
@erickpiva

Copy link
Copy Markdown
Author

Doc changes look great and I like you showcased passing Entity templates to functions! Take a look at some of the comments I left, thanks!

thanks for the review! I agree with the sugesttions and already accepted.

About the unrelated files, This is my first contribution for a OpenSource codebase. I think I clicked something that merge a few commits that happened in between syncing my branch and writing the PR. There is a option for delete those files, by I'm afraid it will commit a deletion of those files from the code base. Let me know if there is something I can do 😅

@mnmaita

mnmaita commented Oct 14, 2026

Copy link
Copy Markdown
Member

Doc changes look great and I like you showcased passing Entity templates to functions! Take a look at some of the comments I left, thanks!

thanks for the review! I agree with the sugesttions and already accepted.

About the unrelated files, This is my first contribution for a OpenSource codebase. I think I clicked something that merge a few commits that happened in between syncing my branch and writing the PR. There is a option for delete those files, by I'm afraid it will commit a deletion of those files from the code base. Let me know if there is something I can do 😅

If you only intend to use the fork to push contributions I'd recommend to always keep your fork's "main" branch in sync with bevy's "main" (there's a handy button in GitHub now to accomplish this), then create new branches off of of it for pushing experimental changes or for feature branches/pull requests.

If you need help with this I can write down some steps and commands for you sometime later.

@alice-i-cecile alice-i-cecile added the C-Docs An addition or correction to our documentation label Oct 14, 2026

@alice-i-cecile alice-i-cecile left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Docs look helpful but the extra files need to be cleaned up :) Force-pushing is fine here.

@alice-i-cecile alice-i-cecile added X-Uncontroversial This work is generally agreed upon S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Oct 14, 2026
@erickpiva

Copy link
Copy Markdown
Author

I correct the extra files but had to open a new PR #26179. I'll close this one. Sorry about the mess and thank you for the patience"

@erickpiva erickpiva closed this Oct 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-Scenes Composing and serializing ECS objects C-Docs An addition or correction to our documentation D-Straightforward Simple bug fixes and API improvements, docs, test and examples S-Waiting-on-Author The author needs to make changes or address concerns before this can be merged X-Uncontroversial This work is generally agreed upon

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants