How can I have AnimationController play the loaded animation ?
See original GitHub issueI’ve managed loaded a simple animation in a test. I’m pretty sure the animation nodes, channels are built correctly. But when I debugged into com.badlogic.gdx.graphics.g3d.utils.AnimationController#update(float), it’s current AnimationDesc member is null. Does this means it’s not started playing? How can I have AnimationController update the loaded animation?
FYI. the test code and assets
public class AnimationLoaderTest extends Game {
public static void main(String[] args) {
new LwjglApplication(new AnimationLoaderTest());
}
private Scene scene;
private SceneManager sceneManager;
private PerspectiveCamera camera;
private SceneAsset sceneAsset;
@Override
public void create() {
sceneAsset = new GLTFLoader().load(Gdx.files.classpath("gltftutorials/khronosgroup/github/simple.gltf"));
scene = new Scene(sceneAsset.scene);
sceneManager = new SceneManager();
sceneManager.addScene(scene);
// setup camera
camera = new PerspectiveCamera(60f, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
camera.near = 0.01f;
camera.far = 4000f;
camera.position.set(0, 0, 3);
camera.lookAt(Vector3.Zero);
sceneManager.setCamera(camera);
}
@Override
public void render() {
float deltaTime = Gdx.graphics.getDeltaTime();
camera.update();
// render
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT | GL20.GL_DEPTH_BUFFER_BIT);
sceneManager.update(deltaTime);
sceneManager.render();
}
}
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
AnimationController - Roblox Creator Documentation
An object which allows animations to be loaded and applied to a character or model in place of a Humanoid when a Humanoid...
Read more >How to make an animation fully load? - Scripting Helpers
1 answer ; 1, local animController = Instance.new( "AnimationController" ) ; 2, local animTrack = animController:LoadAnimation(animation) ; 3 ...
Read more >Animation Parameters - Unity - Manual
Trigger - a boolean parameter that is reset by the controller when consumed by a transition (represented by a circle button). Parameters can...
Read more >Unity load and add animation controller dynamically
You have to put the animation controller in a folder called "Resources" in the Assets folder. You must spell that correctly. Move your...
Read more >lottie | Flutter Package - Pub.dev
The Lottie widget will load the json file and run the animation ... With a custom AnimationController you have a rich API to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
for further help, please use libgdx Discord : https://libgdx.com/community/
your animation need a name to be usable with libgdx, i don’t think this tutorial is a good way to start, better exporting a scene from Blender instead. Or downloading a GLTF file.