Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1446,6 +1446,16 @@ description = "Demonstrates loading from and saving scenes to files"
category = "Scene"
wasm = false

[[example]]
name = "scene_builder"
path = "examples/scene/scene_builder.rs"

[package.metadata.example.scene_builder]
name = "Scene Builder"
description = "Demonstrates building a fine-tuned scene from a world"
category = "Scene"
wasm = false

# Shaders
[[package.metadata.example_category]]
name = "Shaders"
Expand Down
9 changes: 4 additions & 5 deletions crates/bevy_scene/src/dynamic_scene.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,13 @@ pub struct DynamicEntity {

impl DynamicScene {
/// Create a new dynamic scene from a given scene.
pub fn from_scene(scene: &Scene, type_registry: &AppTypeRegistry) -> Self {
Self::from_world(&scene.world, type_registry)
pub fn from_scene(scene: &Scene) -> Self {
Self::from_world(&scene.world)
}

/// Create a new dynamic scene from a given world.
pub fn from_world(world: &World, type_registry: &AppTypeRegistry) -> Self {
let mut builder =
DynamicSceneBuilder::from_world_with_type_registry(world, type_registry.clone());
pub fn from_world(world: &World) -> Self {
let mut builder = DynamicSceneBuilder::from_world(world);

builder.extract_entities(world.iter_entities().map(|entity| entity.id()));
builder.extract_resources();
Expand Down
Loading