Skip to content

Commit

Permalink
add register_extensions feature
Browse files Browse the repository at this point in the history
  • Loading branch information
kayhhh committed Mar 10, 2024
1 parent a39007a commit 654f524
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
3 changes: 2 additions & 1 deletion bevy_gltf_kun/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ default = ["export", "import", "omi_physics"]
export = []
import = []
omi_physics = ["dep:bevy_xpbd_3d", "gltf_kun/omi_physics_body"]
register_extensions = []

[lints.clippy]
type_complexity = "allow"
Expand All @@ -20,8 +21,8 @@ type_complexity = "allow"
bevy = { version = "0.13.0", default-features = false, features = ["animation", "bevy_asset", "bevy_scene", "bevy_pbr"] }
glam.workspace = true
gltf_kun.workspace = true
image = "0.24.9"
serde_json.workspace = true
thiserror.workspace = true

bevy_xpbd_3d = { version = "0.4.2", optional = true }
image = "0.24.9"
18 changes: 16 additions & 2 deletions bevy_gltf_kun/src/import/gltf/loader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,14 @@ where
}

fn extensions(&self) -> &[&str] {
&["gltf"]
#[cfg(feature = "register_extensions")]
{
&["gltf"]
}
#[cfg(not(feature = "register_extensions"))]
{
&[]
}
}
}

Expand Down Expand Up @@ -177,6 +184,13 @@ where
}

fn extensions(&self) -> &[&str] {
&["glb"]
#[cfg(feature = "register_extensions")]
{
&["glb"]
}
#[cfg(not(feature = "register_extensions"))]
{
&[]
}
}
}

0 comments on commit 654f524

Please sign in to comment.