#serialization #bevy #component #bevy-plugin #wrapper #traits #moonshine-save

bevy_serialization_extras

A crate for managing serialization with moonshine_save + wrappers

12 releases (6 breaking)

0.7.0 Nov 20, 2024
0.5.0 Aug 6, 2024
0.4.3 Mar 20, 2024
0.2.1 Nov 9, 2023

#488 in Game dev

Download history 1/week @ 2024-08-16 171/week @ 2024-09-20 52/week @ 2024-09-27 11/week @ 2024-10-04 12/week @ 2024-10-11 7/week @ 2024-10-18 14/week @ 2024-11-01 5/week @ 2024-11-08 111/week @ 2024-11-15 37/week @ 2024-11-22 14/week @ 2024-11-29

170 downloads per month
Used in bevy_serialization_urdf

MIT license

1MB
2K SLoC

Rust 1.5K SLoC // 0.1% comments Rusty Object Notation 313 SLoC

bevy_serialization_extras

A library that allows the editing of non-reflect components via wrapper components, and serialization of these components via moonshine-save:

demo_gif.webm

Features

  • Out of the box serialization Through plugins for components
// Component <-> WrapperComponent
.add_plugins(SerializeComponentFor::<AsyncCollider, ColliderFlag>::default())

// AssetHandle <-> WrapperComponent
.add_plugins(SerializeAssetFor::<StandardMaterial, MaterialFlag>::default())

// WrapperComponent -> AssetHandle
.add_plugins(DeserializeAssetFrom::<GeometryFlag, Mesh>::default())

// Query -> Component, 
.add_plugins(SerializeQueryFor::<Linkage, ImpulseJoint, JointFlag>::default())
  • Serialization of groups of enities that compose an asset into their singular asset equivillent, and vice-versa

See: https://github.com/rydb/bevy_serialization_urdf

//Query <-> Asset
.add_plugins(SerializeManyAsOneFor::<LinkQuery, Urdf>::default())
  • Allows edititing unserializable(non-reflect) implementing components through the wrappers that convert to them

    E.G: Edit Rapier's ImpulseJoint through JointFlag

edit_example.png

  • type registration for wrappers through ManagedTypeRegistration trait

  • A visualization util to list serializable/unserializable components(W.I.P)

Usage

For implementations of plugin trait bounds, see /Wrappers

TODO

  • Add a mechanism for updating from old save versions to new save versions as to not break old save files.

Dependencies

~46–83MB
~1.5M SLoC