I am trying to load an blender animation into libGDX for an android app. So I created an animation using Blenders action editor, I exported this into .fbx format. I then ran the fbx-conv tool to create a .G3DB file. I then proceeded to upload this file into libGDX using the modelLoader.

Everything seems to work fine (I am not receiving any error messages) except that the screen is blank. I can't see any animations or the model.

I have run this code in a Samsung galaxy tablet running kitkat, nexus phone running marshmallow and an emulator, but the same result.

I went thru the tutorials and am using some of the code to upload one of my blender models. I still can't figure this out and I need help figuring this out.

Any help will be greatly appreciated.

Here is the link to the Blender file: Animated Low-Poly Horse No Lights and no Camera

Here is my code where I am uploading the model in libGDX. I basically am using the code from the tutorials

public void create () {

    // Create camera sized to screens width/height with Field of View of 75 degrees
    camera = new PerspectiveCamera(

    // Move the camera 5 units back along the z-axis and look at the origin

    // Near and Far (plane) represent the minimum and maximum ranges of the camera in, um, units
    camera.near = 0.1f;
    camera.far = 300.0f;
    // A ModelBatch is like a SpriteBatch, just for models.  Use it to batch up geometry for OpenGL
    modelBatch = new ModelBatch();

    // Model loader needs a binary json reader to decode
    UBJsonReader jsonReader = new UBJsonReader();
    // Create a model loader passing in our json reader
    G3dModelLoader modelLoader = new G3dModelLoader(jsonReader);
    // Now load the model by name
    // Note, the model (g3db file ) and textures need to be added to the assets folder of the Android proj
    model = modelLoader.loadModel(Gdx.files.getFileHandle("AnimatedLowPolyHorseStageFenced_Ver5.g3db", Files.FileType.Internal));
    // Now create an instance.  Instance holds the positioning data, etc of an instance of your model
    modelInstance = new ModelInstance(model);

    //fbx-conv is supposed to perform this rotation for you... it doesnt seem to
    modelInstance.transform.rotate(1, 0, 0, -90);
    //move the model down a bit on the screen ( in a z-up world, down is -z ).
    modelInstance.transform.translate(0, 0, -2);

    // Finally we want some light, or we wont see our color.  The environment gets passed in during
    // the rendering process.  Create one, then create an Ambient ( non-positioned, non-directional ) light.
    environment = new Environment();
    environment.set(new ColorAttribute(ColorAttribute.AmbientLight, 0.8f, 0.8f, 0.8f, 1.0f));
    environment.add(new DirectionalLight().set(0.8f, 0.8f, 0.8f, -1f, -0.8f, -0.2f));

    // You use an AnimationController to um, control animations.  Each control is tied to the model instance
    controller = new AnimationController(modelInstance);
    // Pick the current animation by name

    controller.setAnimation("Armature|ArmatureAction",1, new AnimationListener(){

        public void onEnd(AnimationDesc animation) {
            // this will be called when the current animation is done.
            // queue up another animation called "balloon".
            // Passing a negative to loop count loops forever.  1f for speed is normal speed.

        public void onLoop(AnimationDesc animation) {
            // TODO Auto-generated method stub




public void resize(int width, int height) {
    super.resize(width, height);

public void render () {
    Gdx.gl.glViewport(0, 0, Gdx.graphics.getWidth(), Gdx.graphics.getHeight());
    //Gdx.gl.glClearColor(1, 1, 1, 1);
    //batch.draw(img, 0, 0);

    // For some flavor, lets spin our camera around the Y axis by 1 degree each time render is called
    //camera.rotateAround(Vector3.Zero, new Vector3(0,1,0),1f);
    // When you change the camera details, you need to call update();
    // Also note, you need to call update() at least once.
    // camera.update();

    // You need to call update on the animation controller so it will advance the animation.  Pass in frame delta
    // Like spriteBatch, just with models!  pass in the box Instance and the environment
    modelBatch.render(modelInstance, environment);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.