question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How can I have AnimationController play the loaded animation ?

See original GitHub issue

I’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();
	}
}

simple.gltf

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mgsx-devcommented, Mar 9, 2021

for further help, please use libgdx Discord : https://libgdx.com/community/

1reaction
mgsx-devcommented, Mar 9, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found