25

How does one export a 3D Studio animated model to OBJ format (if possible)? What will be the resulting file like? How would I read that?

skaffman
  • 398,947
  • 96
  • 818
  • 769
zaratustra
  • 8,148
  • 8
  • 36
  • 42

5 Answers5

23

No, .obj files do not support animation.

You can check the .obj specification for details of what it does support.

You could potentially export one .obj per frame, but that would be cumbersome. Depending on the tools, it may be possible to export one .obj per keyframe.

Brian Campbell
  • 322,767
  • 57
  • 360
  • 340
  • 1
    I was -hoping- I had missed something. Thanks. – zaratustra Apr 16 '09 at 17:37
  • 1
    @DuckMaestro I've replaced it with another link – Brian Campbell Nov 28 '12 at 04:19
  • 1
    Just wanted to point out that this comment is outdated. Obj models CAN support animations if using Blender. Another user stated this below, too. – Krythic Dec 08 '15 at 14:51
  • 1
    @Krythic It is not out of date; animation support has not been added to to the `.obj` format. Any static image format can be used as an animated format with one file per frame, or anything that you could do interpolation with could use one file per keyframe; but just because you can animate a directory full of static JPEGs doesn't mean that JPEG supports animation. – Brian Campbell Dec 09 '15 at 00:30
  • An animation with multiple keyframes can also be exported as a single OBJ file: https://stackoverflow.com/questions/757145/do-wavefront-obj-files-support-animation/13111722#13111722 – baptx Sep 08 '18 at 10:36
18

Blender 2.63 can export animations in .obj, with each keyframe (as hypothesized above) being a complete .obj of it's own. Blender can handle this export func relatively quickly and efficiently. So 1, Blender is an excellent working proof of concept, and two, Blender may actually help you out code wise (it's open source and you can redistribute any edited code source), allowing you to completely bypass writing your own efficient, quick support for this operation.

Bo Persson
  • 90,663
  • 31
  • 146
  • 203
JoryRFerrell
  • 33
  • 2
  • 16
  • 1
    This should be the answer. – Krythic Dec 08 '15 at 14:52
  • 1
    Is it also possible to import multiple .obj or .dae keyframes in Blender so we can view the animation? This would be useful for vertex animation, so we don't need to create a custom tool to view the animation. – baptx Dec 17 '18 at 16:46
11

Although the .obj specification doesnt support animations natively, by simply augmenting it with a seperate .anm file you can get brilliant albeit boneless animations.

Have a look at:- http://public.sanguinelabs.co.uk/expose/product.php?id=wastudio

This provides a very easy to use "animation maker" as well as the open-source model library (for OpenGL).

Note: I am the developer of Wavefront Animation Studio but also use it heavily in my own projects. Feel free to email me if you have any improvements or bugs to report :)

Karsten Pedersen
  • 419
  • 4
  • 11
  • 2
    I no longer have time to maintain it so I released it open-source: https://github.com/osen/wastudio If anyone has issues compiling it; let me know and I can put out some binary releases on the GitHub page. – Karsten Pedersen May 27 '19 at 09:37
  • Now @ https://github.com/Nimajamin/wastudio – Trass3r Mar 04 '22 at 13:11
7

In fact you can animate wavefront format objects, you have to use groups within your model and transform them seperately in your code.

guest
  • 71
  • 1
  • 1
  • Indeed, an animation with multiple keyframes can be exported as a single OBJ file, that's what a reverse engineering project for Spyro games is doing to play characters animations from an OBJ file (http://klimaleksus.narod.ru/Files/6/MoreSpyroModels.rar). – baptx Sep 08 '18 at 10:34
2

.obj files do not support storing animations by default. However, you can export an animated mesh as a sequence of .obj files using Blender 3D. (The .obj exporter contains a relevant option...) If you want to view an animation sequence as .obj files, you can use the following program that is written OpenGL and python:

https://github.com/csmailis/ObjSequenceViewer

If you use it, make sure you specify the directory containing all the .obj files stored with sequential filenames.

dok213
  • 21
  • 1