Skip to content

Commit

Permalink
Add external assets to .gitignore (#17388)
Browse files Browse the repository at this point in the history
Added an external assets section to .gitignore. This prevents
contributors from accidentally adding or committing them.

I believe currently the only externel asset is the meshlet bunny.
  • Loading branch information
alex5nader authored Jan 17, 2025
1 parent 23dbcf9 commit b66c3ce
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
7 changes: 6 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -1249,10 +1249,15 @@ description = "Meshlet rendering for dense high-poly scenes (experimental)"
category = "3D Rendering"
wasm = false
setup = [
[
"mkdir",
"-p",
"assets/external/models",
],
[
"curl",
"-o",
"assets/models/bunny.meshlet_mesh",
"assets/external/models/bunny.meshlet_mesh",
"https://raw.githubusercontent.com/JMS55/bevy_meshlet_asset/7a7c14138021f63904b584d5f7b73b695c7f4bbf/bunny.meshlet_mesh",
],
]
Expand Down
2 changes: 2 additions & 0 deletions assets/external/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
*
!.gitignore
6 changes: 3 additions & 3 deletions examples/3d/meshlet.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ const ASSET_URL: &str =
"https://raw.githubusercontent.com/JMS55/bevy_meshlet_asset/7a7c14138021f63904b584d5f7b73b695c7f4bbf/bunny.meshlet_mesh";

fn main() -> ExitCode {
if !Path::new("./assets/models/bunny.meshlet_mesh").exists() {
eprintln!("ERROR: Asset at path <bevy>/assets/models/bunny.meshlet_mesh is missing. Please download it from {ASSET_URL}");
if !Path::new("./assets/external/models/bunny.meshlet_mesh").exists() {
eprintln!("ERROR: Asset at path <bevy>/assets/external/models/bunny.meshlet_mesh is missing. Please download it from {ASSET_URL}");
return ExitCode::FAILURE;
}

Expand Down Expand Up @@ -80,7 +80,7 @@ fn setup(
// that has been converted to a [`bevy_pbr::meshlet::MeshletMesh`]
// using [`bevy_pbr::meshlet::MeshletMesh::from_mesh`], which is
// a function only available when the `meshlet_processor` cargo feature is enabled.
let meshlet_mesh_handle = asset_server.load("models/bunny.meshlet_mesh");
let meshlet_mesh_handle = asset_server.load("external/models/bunny.meshlet_mesh");
let debug_material = debug_materials.add(MeshletDebugMaterial::default());

for x in -2..=2 {
Expand Down

0 comments on commit b66c3ce

Please sign in to comment.