Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Reuse the same scene from gltf file brakes scene animation #8995

Closed
volodalexey opened this issue Jun 29, 2023 · 0 comments
Closed

Reuse the same scene from gltf file brakes scene animation #8995

volodalexey opened this issue Jun 29, 2023 · 0 comments
Labels
C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled

Comments

@volodalexey
Copy link

Bevy version

0.10.1

What you did

For example you can use the official animated_fox example. After spawning the first fox, try to spawn the second fox at line 74:

// Fox
commands.spawn(SceneBundle {
    scene: asset_server.load("models/animated/Fox.glb#Scene0"),
    ..default()
});

commands.spawn(SceneBundle {
    transform: Transform::from_xyz(50.0, 0.0, 0.0),
    scene: asset_server.load("models/animated/Fox.glb#Scene0"),
    ..default()
});

As a result animation for the first fox and second will be broken.
Instance of player if let Ok(mut player) = player.get_single_mut() - will never be acquired.

What went wrong

When I copy the same scene at least second time - animation will be broken.

I want to load gltf/glb file and spawn multiple instances of the same mesh/scene with its own animation.
E.g. gltf file contains ball-mesh + ball-animation, animation is simple just to rotate the ball around its origin.
Next I want to spawn these balls by timer. Each ball should also use the same animation and mesh/scene.
I want to prepare animations and scenes in Blender.

Some thoughts

It is unclear, how instanse of AnimationPlayer is added. My main target would be WASM - so I want to decrease network requests - and I want to have one gltf file with multiple scenes - e.g. scene-player-ball-and-animation + scene-enemy-ball-and-animation, etc.

  • Why SceneBundle do not spawn animation atomatically from file?
  • Is it possible to spawn AnimationPlayer manually, e.g. combine SceneBundle from gltf file manually ?

Might be connected with:
#5848
#1802

@volodalexey volodalexey added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Jun 29, 2023
@nicopap nicopap converted this issue into discussion #8996 Jun 29, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled
Projects
None yet
Development

No branches or pull requests

1 participant