-
Notifications
You must be signed in to change notification settings - Fork 351
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs(gltf_extras): added small description of the newly added gltf_ex…
…tras (#1387) Co-authored-by: Alice Cecile <[email protected]>
- Loading branch information
1 parent
59dcbf3
commit ade4ade
Showing
1 changed file
with
31 additions
and
3 deletions.
There are no files selected for viewing
34 changes: 31 additions & 3 deletions
34
...lease-notes/13453_add_handling_of_all_missing_gltf_extras_scene_mesh__materi.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,32 @@ | ||
<!-- add handling of all missing gltf extras: scene, mesh & materials --> | ||
<!-- https://github.com/bevyengine/bevy/pull/13453 --> | ||
|
||
<!-- TODO --> | ||
The glTF 3D model file format allows passing additional user defined metadata in the *extras* properties, and | ||
in addition to the glTF extras at the primitive/node level , Bevy now has specific GltfExtras for: | ||
- scenes: **SceneGltfExtras** injected at the scene level if any | ||
- meshes: **MeshGltfExtras**, injected at the mesh level if any | ||
- materials: **MaterialGltfExtras**, injected at the mesh level if any: ie if a mesh has a material that has gltf extras, the component will be injected there. | ||
|
||
You can now easily query for these specific extras | ||
|
||
```rust | ||
fn check_for_gltf_extras( | ||
gltf_extras_per_entity: Query<( | ||
Entity, | ||
Option<&Name>, | ||
Option<&GltfSceneExtras>, | ||
Option<&GltfExtras>, | ||
Option<&GltfMeshExtras>, | ||
Option<&GltfMaterialExtras>, | ||
)>, | ||
) { | ||
// use the extras' data | ||
for (id, name, scene_extras, extras, mesh_extras, material_extras) in | ||
gltf_extras_per_entity.iter() | ||
{ | ||
|
||
} | ||
} | ||
|
||
``` | ||
|
||
This makes passing information from programs such as Blender to Bevy via gltf files more spec compliant, and more practical ! | ||
|