Skip to content
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

Save Scenes throws error #43

Open
PhaestusFox opened this issue Oct 24, 2022 · 2 comments
Open

Save Scenes throws error #43

PhaestusFox opened this issue Oct 24, 2022 · 2 comments

Comments

@PhaestusFox
Copy link
Contributor

when saving a scene it fails because "Type 'core::option::Option<bevy_render::camera::camera::Viewport>' did not register ReflectSerialize.

this feels like it should no prevent the saving a scene and just skip the missing types

@jakobhellermann
Copy link
Owner

I don't think this is in my control as I just serialize the whole world and display any errors coming from the serialization:

let scene = DynamicScene::from_world(&world, type_registry);
let ron = scene.serialize_ron(type_registry)?;

If you want to be able to serialize scenes where not every component is serializable and they are just skipped, I believe this would need support from bevy itself.
Until then you can just call .register_type::<Option<Viewport>>() once in your app to fix it, until 0.9 gets released with bevyengine/bevy#5747.

@PhaestusFox
Copy link
Contributor Author

ah yes my confusion is that bevy already skips anything that doesn't reflect component but just because it reflects component doesn't mean it reflects serializable.
I am working on a from_world that will only serialize an entity matching the query, if I get it working ill submit a pull that will allow people to use your editor in a way it won't serialise the editor-specific entities such as the cameras.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants