-
I'm making an exporter for blender, so that I can work on a 3D game with a bunch of assets and not have to create all my scene trees manually (and I'm not using GLTF so I can insert custom components easily). As such, I'm trying to load quite complex scene files. Generating simple examples with transforms and some simple custom components is working well, but where I'm struggling is loading Children. Working from the parenting and scene examples, I saved a scene file to see how it encoded parenting: fn save_scene_system(_world: &mut World, resources: &mut Resources) {
// Scenes can be created from any ECS World. You can either create a new one for the scene or use the current World.
let mut world = World::new();
let child = world.spawn(());
let child2 = world.spawn(());
world.spawn((
Children::with(&[child, child2]),
));
// The TypeRegistry resource contains information about all registered types (including components). This is used to construct scenes.
let type_registry = resources.get::<TypeRegistry>().unwrap();
let scene = DynamicScene::from_world(&world, &type_registry);
// Scenes can be serialized like this:
println!("{}", scene.serialize_ron(&type_registry).unwrap());
} This produced the scene file:
I then tried to load this scene with: let scene_handle: Handle<DynamicScene> = asset_server.load("test.scn"); But his produced:
Attempting to register it produces:
I don't really care how ergonomic it is (as scenes are generated by a script), but is there any way to load a scene heirarchy at the moment? Note: This is with Bevy 0.4.0. I'm currently updating to try with the latest version on git. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Works fine on latest |
Beta Was this translation helpful? Give feedback.
Works fine on latest
main
.