Skip to content

Commit 74ead1e

Browse files
Add GltfLoaderSettings (#10804)
# Objective when loading gltfs we may want to filter the results. in particular, i need to be able to exclude cameras. i can do this already by modifying the gltf after load and before spawning, but it seems like a useful general option. ## Solution add `GltfLoaderSettings` struct with bool members: - `load_cameras` : checked before processing camera nodes. - `load_lights` : checked before processing light nodes - `load_meshes` : checked before loading meshes, materials and morph weights Existing code will work as before. Now you also have the option to restrict what parts of the gltf are loaded. For example, to load a gltf but exclude the cameras, replace a call to `asset_server.load("my.gltf")` with: ```rust asset_server.load_with_settings( "my.gltf", |s: &mut GltfLoaderSettings| { s.load_cameras = false; } ); ``` --------- Co-authored-by: Alice Cecile <[email protected]>
1 parent 0a588db commit 74ead1e

File tree

1 file changed

+208
-159
lines changed

1 file changed

+208
-159
lines changed

0 commit comments

Comments
 (0)