# apply animation to imported model 

**URL:** <https://discourse.threejs.org/t/apply-animation-to-imported-model/2788>\
**Category:** Discussion\
**Tags:** animation\
**Created:** [May 10, 2018, 4:32am UTC](https://discourse.threejs.org/t/apply-animation-to-imported-model/2788 "2018-05-10T04:32:06Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![kof](https://avatars.discourse-cdn.com/v4/letter/k/8edcca/32.png) [@kof](https://discourse.threejs.org/u/kof)\
**Post date:** [May 10, 2018, 4:32am UTC](https://discourse.threejs.org/t/apply-animation-to-imported-model/2788/1 "2018-05-10T04:32:06Z")

</div>

Hi guys,

I have a project using Three.js to display simulation, here’s the step:

1, export model in obj file, export the animation data in customized json file.

2, load the obj file in three.js and apply animation to the imported model.

It works great till I try to upgrade three.js to r86, which have a brand new animation system.

I’ve tried to apply animation to imported model with r86, but I can’t use any animation function outside loaders…

I know I can export the model and animation in other file format and convert old file to new ones,

but don’t you think it would be more comfortable to have tools to apply customized animation outside loaders?

or any idea for work-around?

---

<div class="post-metadata">

**Author:** ![looeee](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/looeee/32/59_2.png) [@looeee](https://discourse.threejs.org/u/looeee)\
**Post date:** [May 10, 2018, 4:35am UTC](https://discourse.threejs.org/t/apply-animation-to-imported-model/2788/2 "2018-05-10T04:35:29Z")

</div>

> [@kof](#):
>
> I know I can export the model and animation in other file format and convert old file to new ones,

That’s probably the best thing to do here. Use FBX or glTF format if possible.

---

<div class="post-metadata">

**Author:** ![kof](https://avatars.discourse-cdn.com/v4/letter/k/8edcca/32.png) [@kof](https://discourse.threejs.org/u/kof)\
**Post date:** [May 10, 2018, 5:14am UTC](https://discourse.threejs.org/t/apply-animation-to-imported-model/2788/3 "2018-05-10T05:14:13Z")

</div>

Thanks for your advise, but why FBX or giTF is better than other format like json, or colloda?

---

<div class="post-metadata">

**Author:** ![looeee](https://yyz1.discourse-cdn.com/flex035/user_avatar/discourse.threejs.org/looeee/32/59_2.png) [@looeee](https://discourse.threejs.org/u/looeee)\
**Post date:** [May 10, 2018, 6:41am UTC](https://discourse.threejs.org/t/apply-animation-to-imported-model/2788/4 "2018-05-10T06:41:38Z")

</div>

The file sizes will be smaller and support for loaders and exporters will be better. In general, the best-supported formats for three.js are Collada, OBJ, FBX and glTF.

However OBJ doesn’t support animations, and Collada file sizes will be bigger. The three.js JSON format was created at a time when there was no good web format for 3D assets, however, it’s slowly being replaced by glTF.

glTF is the recommended format going forward, but not all applications have good exporters yet - in particular, if you’re using Autodesk products then FBX will be easier.

---

<div class="post-metadata">

**Author:** ![kof](https://avatars.discourse-cdn.com/v4/letter/k/8edcca/32.png) [@kof](https://discourse.threejs.org/u/kof)\
**Post date:** [May 25, 2018, 4:31am UTC](https://discourse.threejs.org/t/apply-animation-to-imported-model/2788/5 "2018-05-25T04:31:09Z")

</div>

Hi looeee,

Thanks for your specific information~

It seems that gltf/glb is the best file format for 3d things.

Is there any easy way to write my mesh data into glb/gltf file format?  
Or any C++ project to generate glb or gltf file?

Thanks

---

<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:** [May 25, 2018, 6:13am UTC](https://discourse.threejs.org/t/apply-animation-to-imported-model/2788/6 "2018-05-25T06:13:09Z")

</div>

See list of tools here: [https://github.com/khronosgroup/gltf#gltf-tools](https://github.com/khronosgroup/gltf#gltf-tools)

I recommend starting with [Blender](https://github.com/KhronosGroup/glTF-Blender-Exporter) or one of the converters typically, but there are also C++ utilities.
