Crates.io | bevy_gltf_trait |
lib.rs | bevy_gltf_trait |
version | |
source | src |
created_at | 2024-07-08 11:08:02.538398 |
updated_at | 2024-12-10 14:11:01.351135 |
description | Customizable Bevy Engine GLTF loading |
homepage | |
repository | https://github.com/dekirisu/bevy_gltf_trait |
max_upload_size | |
id | 1295654 |
Cargo.toml error: | TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include` |
size | 0 |
This is a fork of bevy /crates/bevy_gltf
, that doesn't change any functionalities, but provides several possibilities to customize
the conversion between gltf and bevy interns on load
using the trait GltfTrait
.
default: &["gltf", "glb"]
Material
usedStandardMaterial
sMesh
EntityWorldMut
(similar to EntityCommands
)Transform
and EntityWorldMut
of their parentSpotLight
, PointLight
or DirectionalLight
componentsEntityWorldMut
Transform
and EntityWorldMut
of their parentApp
on_app
to .register_type()
themBevy | This |
---|---|
0.15 | 0.2 |
0.14 | 0.1 |
The original way of adding the plugin changes to:
fn main(){
let mut app = App::new();
app.add_plugins((
MinimalPlugins,
GltfPlugin::<()>::default(),
// ...
));
app.run();
}
..and can be modified with the trait to either replace or extend (using different extensions) scene imports.
#[derive(Reflect,Default)]
struct WhiteGltf;
impl GltfTrait for WhiteGltf {
const EXTENSIONS: &'static [&'static str] = &["myglb"];
type Material = StandardMaterial;
fn convert_material (mut convert:GltfTraitMaterial) -> Self::Material {
convert.material.base_color = Color::WHITE;
convert.material.base_color_texture = None;
convert.material
}
}
fn main(){
let mut app = App::new();
app.add_plugins((
DefaultPlugins,
GltfPlugin::<WhiteGltf>::default()
));
app.run();
}
bevy | bevy_gltf_trait |
---|---|
0.14 | 0.1 |