Skip to content

Extraction Example #23223

Merged
alice-i-cecile merged 13 commits intobevyengine:mainfrom
PVDoriginal:extraction-example
Mar 16, 2026
Merged

Extraction Example #23223
alice-i-cecile merged 13 commits intobevyengine:mainfrom
PVDoriginal:extraction-example

Conversation

@PVDoriginal
Copy link
Copy Markdown
Contributor

An example demonstrating automatic and manual extraction of components from the Main World to the Render World.

This is a common point of confusion for new users that want to do custom rendering, and I don't think any of the current examples show how to manually extract components (or aren't at all focused on it at least).

In the future this should probably be changed to be about extraction between two arbitrary worlds, instead of being specific to the Render World. Possibly after / if github.com//pull/22852 is merged.

Copy link
Copy Markdown
Contributor

@ChristopherBiscardi ChristopherBiscardi left a comment

Choose a reason for hiding this comment

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

Good first step for an extraction example. The most important changes I mentioned are the Example naming/category ones so that this isn't named "Custom Schedule" by accident. The other changes are ones I think would be good but reasonable people could disagree.

@ChristopherBiscardi ChristopherBiscardi added A-Rendering Drawing game state to the screen A-ECS Entities, components, systems, and events C-Examples An addition or correction to our examples S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Mar 4, 2026
@github-project-automation github-project-automation bot moved this to Needs SME Triage in ECS Mar 4, 2026
@github-project-automation github-project-automation bot moved this to Needs SME Triage in Rendering Mar 4, 2026
Copy link
Copy Markdown
Contributor

@ChristopherBiscardi ChristopherBiscardi left a comment

Choose a reason for hiding this comment

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

A solid first land for documenting extraction! Now we have somewhere to point people to that they can run to look at what is actually happening, especially relating to "are they on the same entities", "when do the value update", etc.

PVDoriginal and others added 3 commits March 5, 2026 20:14
Cargo.toml Outdated

[package.metadata.example.extraction]
name = "Extraction"
description = "Demonstrates different ways to extract components"
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.

This example description is unhelpful: you need to explain what "extracting components" means to people who have never heard of it.

@@ -0,0 +1,125 @@
//! Demonstrates different ways to extract components to another world.
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.

These introductory needs additional context on why you might want to do this. Focusing on the rendering use case is fine.

Copy link
Copy Markdown
Member

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

Choose a reason for hiding this comment

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

Content looks good, but it needs some work around framing to make this clear to intermediate users.

Copy link
Copy Markdown
Member

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

Choose a reason for hiding this comment

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

Descriptions are much improved, thanks!

Might make more sense in a rendering-related example folder, but that's non-blocking.

@alice-i-cecile alice-i-cecile added S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it and removed S-Needs-Review Needs reviewer attention (from anyone!) to move forward labels Mar 9, 2026
@ChristopherBiscardi
Copy link
Copy Markdown
Contributor

Might make more sense in a rendering-related example folder, but that's non-blocking.

I believe the intent here is accommodating for recent work like #22852 which means extraction is not rendering-only as a feature, even if that's where it is most often used at the moment.

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Mar 16, 2026
Merged via the queue into bevyengine:main with commit 00b1ff5 Mar 16, 2026
44 checks passed
@github-project-automation github-project-automation bot moved this from Needs SME Triage to Done in ECS Mar 16, 2026
@github-project-automation github-project-automation bot moved this from Needs SME Triage to Done in Rendering Mar 16, 2026
splo pushed a commit to splo/bevy that referenced this pull request Mar 31, 2026
An example demonstrating automatic and manual extraction of components
from the Main World to the Render World.

This is a common point of confusion for new users that want to do custom
rendering, and I don't think any of the current examples show how to
manually extract components (or aren't at all focused on it at least).

In the future this should probably be changed to be about extraction
between two arbitrary worlds, instead of being specific to the Render
World. Possibly after / if github.com/bevyengine/pull/22852 is
merged.

---------

Co-authored-by: Chris Biscardi <chris@christopherbiscardi.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-ECS Entities, components, systems, and events A-Rendering Drawing game state to the screen C-Examples An addition or correction to our examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

Status: Done
Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants