mirror of
https://github.com/storytold/storyteller-bevy.git
synced 2026-10-17 00:13:17 +00:00
Mixamo FBX -> glTF test
This commit is contained in:
@@ -197,7 +197,7 @@ export class AppElement extends LitElement {
|
||||
></sts-bvh-viewer>
|
||||
` : html`
|
||||
<sts-viewer
|
||||
objectId="sample-room.gltf"
|
||||
objectId="hip-hop-dancing.gltf"
|
||||
skyboxId="test_scene"
|
||||
.mode=${this.mode}
|
||||
@scene-state=${this.onSceneStateChange}
|
||||
|
||||
Binary file not shown.
File diff suppressed because it is too large
Load Diff
+25
-1
@@ -59,7 +59,13 @@ impl Plugin for ScenePlugin {
|
||||
.add_systems(
|
||||
OnEnter(SceneState::Active),
|
||||
(
|
||||
(tag_scene_elements, apply_deferred, tag_skeleton).chain(),
|
||||
(
|
||||
tag_scene_elements,
|
||||
apply_deferred,
|
||||
tag_skeleton,
|
||||
play_animation,
|
||||
)
|
||||
.chain(),
|
||||
spawn_main_scene_light,
|
||||
frame_scene_in_view,
|
||||
)
|
||||
@@ -338,6 +344,24 @@ fn tag_skeleton(
|
||||
}
|
||||
}
|
||||
|
||||
// TODO
|
||||
fn play_animation(
|
||||
r_scene: Res<ActiveScene>,
|
||||
ra_gltfs: Res<Assets<Gltf>>,
|
||||
mut q_players: Query<&mut AnimationPlayer>,
|
||||
) {
|
||||
let Some(gltf) = ra_gltfs.get(&r_scene.source) else {
|
||||
return;
|
||||
};
|
||||
let Some(anim) = gltf.animations.first() else {
|
||||
return;
|
||||
};
|
||||
|
||||
for mut player in q_players.iter_mut() {
|
||||
player.play(anim.clone_weak()).repeat();
|
||||
}
|
||||
}
|
||||
|
||||
fn spawn_main_scene_light(
|
||||
mut cmd: Commands,
|
||||
r_scene_spawner: Res<SceneSpawner>,
|
||||
|
||||
Reference in New Issue
Block a user