# Add animation to GLB model

**URL:** <https://discourse.threejs.org/t/add-animation-to-glb-model/44275>\
**Category:** Questions\
**Tags:** glb, skeleton, bones, mixamo, animation\
**Created:** [November 2, 2022, 5:27pm UTC](https://discourse.threejs.org/t/add-animation-to-glb-model/44275 "2022-11-02T17:27:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shikitos](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/shikitos/32/15212_2.png) [@shikitos](https://discourse.threejs.org/u/shikitos)\
**Post date:** [November 2, 2022, 5:27pm UTC](https://discourse.threejs.org/t/add-animation-to-glb-model/44275/1 "2022-11-02T17:27:29Z")

</div>

Hello, I have a problem. I have the following problem: there is a model without animation and there is an animation in .fbx format, downloaded from mixamo (without skin). I want to add animation from mixamo and run it on .glb model.

I was able to do this, but only on a model that I imported into mixamo and auto-rigged.

So I’m inclined to think that I need to work with the bones somehow (maybe load the model and copy those resulting bones?).

Here’s a little piece of code of how I do it (I hope it gives clarity to the picture).

Thank you all in advance for your help!

```javascript
gltfLoader.load('https://www.dl.dropboxusercontent.com/s/ekfo3obceiyr1h2/avatar_ytdqb%20%281%29.glb?dl=1', function ( gltf ) {
            const firstHelper = new THREE.SkeletonHelper( gltf.scene );
            scene.add( firstHelper );
            let obj = gltf.scene
            obj.scale.set(100, 100, 100)
            mixer = new THREE.AnimationMixer(obj);
            scene.add( obj );
            obj.name = "modelToAnimate"
            gltf.animations; // Array<THREE.AnimationClip>
            gltf.scene; // THREE.Group
            gltf.scenes; // Array<THREE.Group>
            gltf.cameras; // Array<THREE.Camera>
            gltf.asset; // Object
            console.log("@@@@@ LOAD GLB OBJECT", obj)
            fbxLoader.load('./models/vanguard@samba.fbx', 
                function (object) {
                    object.name = "animation"
                    object.scale.set(0.01, 0.01, 0.01);
                    const animationAction = mixer.clipAction(
                        object.animations[0]
                        );
                }, 
                // called while loading is progressing
                function (xhr){

                    console.log( ( xhr.loaded / xhr.total * 100 ) + '% animations\'s loaded' );

                }, 
                // called when loading has errors
                function (error) {

                    console.error( 'An error happened', error );

                }

            );

        },
        // called while loading is progressing
        function ( xhr ) {

            console.log( ( xhr.loaded / xhr.total * 100 ) + '% loaded' );

        },
        // called when loading has errors
        function ( error ) {

            console.error( 'An error happened', error );

        }
    );

```

---

<div class="post-metadata">

**Author:** ![donmccurdy](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/donmccurdy/32/33209_2.png) [@donmccurdy](https://discourse.threejs.org/u/donmccurdy)\
**Post date:** [November 4, 2022, 12:57pm UTC](https://discourse.threejs.org/t/add-animation-to-glb-model/44275/2 "2022-11-04T12:57:24Z")

</div>

I think it will be a bad time trying to apply an FBX animation to a glTF file using code. They’re very different formats, with different conventions and structures. Even if your model and animation are in the _same_ format, you have to be super careful that the skeleton and the IBMs are exactly matching when combining them.

It would be best to first load these files in Blender, then either merge them there or export them to the same format.
