{"id":15017984,"url":"https://github.com/niklasei/bevy_common_assets","last_synced_at":"2025-05-15T07:07:29.283Z","repository":{"id":40441739,"uuid":"487551596","full_name":"NiklasEi/bevy_common_assets","owner":"NiklasEi","description":"Collection of generic asset loaders for common file formats","archived":false,"fork":false,"pushed_at":"2025-04-26T13:59:17.000Z","size":91,"stargazers_count":212,"open_issues_count":3,"forks_count":32,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-10T15:11:20.458Z","etag":null,"topics":["assets","bevy","bevy-plugin","game-development","hacktoberfest","rust"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/NiklasEi.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-05-01T13:58:59.000Z","updated_at":"2025-05-08T13:10:04.000Z","dependencies_parsed_at":"2024-01-07T19:26:11.861Z","dependency_job_id":"6b76a894-8d2d-4f08-a8a9-7154919803d2","html_url":"https://github.com/NiklasEi/bevy_common_assets","commit_stats":{"total_commits":76,"total_committers":10,"mean_commits":7.6,"dds":"0.19736842105263153","last_synced_commit":"7618bc5d7d02fb6918ae46568a3dd2ea22dfe435"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NiklasEi%2Fbevy_common_assets","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NiklasEi%2Fbevy_common_assets/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NiklasEi%2Fbevy_common_assets/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/NiklasEi%2Fbevy_common_assets/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/NiklasEi","download_url":"https://codeload.github.com/NiklasEi/bevy_common_assets/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254292043,"owners_count":22046426,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["assets","bevy","bevy-plugin","game-development","hacktoberfest","rust"],"created_at":"2024-09-24T19:51:17.265Z","updated_at":"2025-05-15T07:07:29.197Z","avatar_url":"https://github.com/NiklasEi.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Bevy common assets\n\n[![crates.io](https://img.shields.io/crates/v/bevy_common_assets.svg)](https://crates.io/crates/bevy_common_assets)\n[![docs](https://docs.rs/bevy_common_assets/badge.svg)](https://docs.rs/bevy_common_assets)\n[![license](https://img.shields.io/crates/l/bevy_common_assets)](https://github.com/NiklasEi/bevy_common_assets#license)\n[![crates.io](https://img.shields.io/crates/d/bevy_common_assets.svg)](https://crates.io/crates/bevy_common_assets)\n\nCollection of [Bevy][bevy] plugins offering generic asset loaders and writers for common file formats.\n\nSupported formats:\n\n| format     | feature    | example                                 |\n|:-----------|:-----------|:----------------------------------------|\n| `json`     | `json`     | [`json.rs`](./examples/json.rs)         |\n| `msgpack`  | `msgpack`  | [`msgpack.rs`](./examples/msgpack.rs)   |\n| `postcard` | `postcard` | [`postcard.rs`](./examples/postcard.rs) |\n| `ron`      | `ron`      | [`ron.rs`](./examples/ron.rs)           |\n| `toml`     | `toml`     | [`toml.rs`](./examples/toml.rs)         |\n| `xml`      | `xml`      | [`xml.rs`](./examples/xml.rs)           |\n| `yaml`     | `yaml`     | [`yaml.rs`](./examples/yaml.rs)         |\n| `csv`      | `csv`      | [`csv.rs`](./examples/csv.rs)           |\n\n## Usage\n\nEnable the feature(s) for the format(s) that you want to use.\n\nDefine the types that you would like to load from files and derive `serde::Deserialize`, `bevy::reflect::TypePath`, and `bevy::asset::Asset` for them.\n```rust\n#[derive(serde::Deserialize, bevy::asset::Asset, bevy::reflect::TypePath)]\nstruct Level {\n    positions: Vec\u003c[f32;3]\u003e,\n}\n```\n\nWith the types ready, you can start adding asset plugins. Every plugin gets the asset type that it is supposed to load\nas a generic parameter. You can also configure custom file endings for each plugin:\n```rust no_run\nuse bevy::prelude::*;\nuse bevy_common_assets::json::JsonAssetPlugin;\nuse bevy_common_assets::msgpack::MsgPackAssetPlugin;\nuse bevy_common_assets::postcard::PostcardAssetPlugin;\nuse bevy_common_assets::ron::RonAssetPlugin;\nuse bevy_common_assets::toml::TomlAssetPlugin;\nuse bevy_common_assets::xml::XmlAssetPlugin;\nuse bevy_common_assets::yaml::YamlAssetPlugin;\n\nfn main() {\n    App::new()\n        .add_plugins((\n            DefaultPlugins,\n            JsonAssetPlugin::\u003cLevel\u003e::new(\u0026[\"level.json\", \"custom.json\"]),\n            RonAssetPlugin::\u003cLevel\u003e::new(\u0026[\"level.ron\"]),\n            MsgPackAssetPlugin::\u003cLevel\u003e::new(\u0026[\"level.msgpack\"]),\n            PostcardAssetPlugin::\u003cLevel\u003e::new(\u0026[\"level.postcard\"]),\n            TomlAssetPlugin::\u003cLevel\u003e::new(\u0026[\"level.toml\"]),\n            XmlAssetPlugin::\u003cLevel\u003e::new(\u0026[\"level.xml\"]),\n            YamlAssetPlugin::\u003cLevel\u003e::new(\u0026[\"level.yaml\"])\n        ))\n        // ...\n        .run();\n}\n\n#[derive(serde::Deserialize, bevy::asset::Asset, bevy::reflect::TypePath)]\nstruct Level {\n    positions: Vec\u003c[f32; 3]\u003e,\n}\n```\n\nThe example above will load `Level` structs from json files ending on `.level.json` or `.custom.json`, from\nron files ending on `.level.ron` and so on...\n\nSee the [examples](./examples) for working Bevy apps using the different formats.\n\n## Asset savers / using the loaders in .meta files\n\nThe more involved [example `asset_savers`](./examples/asset_savers) demonstrates how you can convert a json\nasset into a processed postcard asset using the `JsonAssetLoader` and `PostcardAssetSaver`.\n\n## Compatible Bevy versions\n\nThe main branch is compatible with the latest Bevy release.\n\nCompatibility of `bevy_common_assets` versions:\n\n| `bevy_common_assets` | `bevy` |\n|:---------------------|:-------|\n| `0.13`               | `0.16` |\n| `0.12`               | `0.15` |\n| `0.11`               | `0.14` |\n| `0.10`               | `0.13` |\n| `0.8` - `0.9`        | `0.12` |\n| `0.7`                | `0.11` |\n| `0.5` - `0.6`        | `0.10` |\n| `0.4`                | `0.9`  |\n| `0.3`                | `0.8`  |\n| `0.1` - `0.2`        | `0.7`  |\n| `main`               | `0.13` |\n| `bevy_main`          | `main` |\n\n## License\n\nDual-licensed under either of\n\n* Apache License, Version 2.0, ([LICENSE-APACHE](/LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0)\n* MIT license ([LICENSE-MIT](/LICENSE-MIT) or https://opensource.org/licenses/MIT)\n\nat your option.\n\n## Contribution\n\nUnless you explicitly state otherwise, any contribution intentionally submitted\nfor inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any\nadditional terms or conditions.\n\n[bevy]: https://bevyengine.org/\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniklasei%2Fbevy_common_assets","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fniklasei%2Fbevy_common_assets","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fniklasei%2Fbevy_common_assets/lists"}