Fix validation errors in Fox.glb (#17801)

# Objective

Fix gltf validation errors in `Fox.glb`.

Inspired by #8099, but that issue doesn't appear to describe a real bug
to fix, as far as I can tell.

## Solution

Use the latest version of the Fox from
[glTF-Sample-Assets](https://github.com/KhronosGroup/glTF-Sample-Assets/blob/main/Models/Fox/glTF-Binary/Fox.glb).

## Testing

Dropped both versions in https://github.khronos.org/glTF-Validator/

`cargo run --example animated_mesh` seems to still look fine.

Before:

```
The asset contains errors.
"numErrors": 126,
"numWarnings": 4184,
```

After:

```
The asset is valid.
"numErrors": 0,
"numWarnings": 0,
```

## Discussion

The 3d testbed was panicking with
```
thread 'main' panicked at examples/testbed/3d.rs:288:60:
called `Result::unwrap()` on an `Err` value: QueryDoesNotMatch(35v1 with components Transform, GlobalTransform, Visibility, InheritedVisibility, ViewVisibility, ChildOf, Children, Name)
```
Which is bizarre. I think this might be related to #17720, or maybe the
structure of the gltf changed.

I fixed it by using updating the testbed to use a more robust method of
finding the correct entity as is done in `animated_mesh`.
This commit is contained in:
Rob Parrett 2025-02-11 15:19:24 -07:00 committed by GitHub
parent aa8793f6b4
commit 0cb3eaef67
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 14 deletions

View File

@ -32,7 +32,7 @@
* Epic orchestra music sample, modified to loop, from [Migfus20](https://freesound.org/people/Migfus20/sounds/560449/) ([CC BY 4.0 DEED](https://creativecommons.org/licenses/by/4.0/)) * Epic orchestra music sample, modified to loop, from [Migfus20](https://freesound.org/people/Migfus20/sounds/560449/) ([CC BY 4.0 DEED](https://creativecommons.org/licenses/by/4.0/))
[MorphStressTest]: https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/MorphStressTest [MorphStressTest]: https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/MorphStressTest
[fox]: https://github.com/KhronosGroup/glTF-Sample-Models/tree/master/2.0/Fox [fox]: https://github.com/KhronosGroup/glTF-Sample-Assets/tree/main/Models/Fox
[by PixelMannen]: https://opengameart.org/content/fox-and-shiba [by PixelMannen]: https://opengameart.org/content/fox-and-shiba
[by @tomkranis on Sketchfab]: https://sketchfab.com/models/371dea88d7e04a76af5763f2a36866bc [by @tomkranis on Sketchfab]: https://sketchfab.com/models/371dea88d7e04a76af5763f2a36866bc
[CC-BY 4.0]: https://creativecommons.org/licenses/by/4.0/ [CC-BY 4.0]: https://creativecommons.org/licenses/by/4.0/

Binary file not shown.

View File

@ -282,19 +282,19 @@ mod animation {
animation: Res<Animation>, animation: Res<Animation>,
mut players: Query<(Entity, &mut AnimationPlayer)>, mut players: Query<(Entity, &mut AnimationPlayer)>,
) { ) {
let entity = children.get(trigger.target()).unwrap()[0]; for child in children.iter_descendants(trigger.target()) {
let entity = children.get(entity).unwrap()[0]; if let Ok((entity, mut player)) = players.get_mut(child) {
let mut transitions = AnimationTransitions::new();
transitions
.play(&mut player, animation.animation, Duration::ZERO)
.seek_to(0.5)
.pause();
let (entity, mut player) = players.get_mut(entity).unwrap(); commands
let mut transitions = AnimationTransitions::new(); .entity(entity)
transitions .insert(AnimationGraphHandle(animation.graph.clone()))
.play(&mut player, animation.animation, Duration::ZERO) .insert(transitions);
.seek_to(0.5) }
.pause(); }
commands
.entity(entity)
.insert(AnimationGraphHandle(animation.graph.clone()))
.insert(transitions);
} }
} }