Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(gltf_extras): added small description of the newly added gltf_extras #1387

Merged
merged 3 commits into from
Jun 11, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 file format allows passing additional user defined metadata in the *extras* properties, and
alice-i-cecile marked this conversation as resolved.
Show resolved Hide resolved
in addition to the gltf extras at the primitive/node level , Bevy now has specific GltfExtras for:
alice-i-cecile marked this conversation as resolved.
Show resolved Hide resolved
- 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 easilly query for these specific extras

Check warning on line 8 in release-content/0.14/release-notes/13453_add_handling_of_all_missing_gltf_extras_scene_mesh__materi.md

View workflow job for this annotation

GitHub Actions / typos

"easilly" should be "easily".
alice-i-cecile marked this conversation as resolved.
Show resolved Hide resolved

```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 !

Loading