Do Wavefront .obj files support animation?
Asked Answered
D

5

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?

Demirep answered 16/4, 2009 at 17:14 Comment(0)
L
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.

Lodged answered 16/4, 2009 at 17:27 Comment(5)
I was -hoping- I had missed something. Thanks.Demirep
@DuckMaestro I've replaced it with another linkLodged
Just wanted to point out that this comment is outdated. Obj models CAN support animations if using Blender. Another user stated this below, too.Hostetter
@Hostetter 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.Lodged
An animation with multiple keyframes can also be exported as a single OBJ file: #757645Interphase
S
20

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.

Stet answered 16/4, 2009 at 17:14 Comment(2)
This should be the answer.Hostetter
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.Interphase
M
12

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 :)

Mandelbaum answered 14/2, 2012 at 17:36 Comment(2)
I no longer have time to maintain it so I released it open-source: 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.Mandelbaum
Now @ github.com/Nimajamin/wastudioSlot
C
7

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

Crooked answered 28/10, 2012 at 18:30 Comment(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 (klimaleksus.narod.ru/Files/6/MoreSpyroModels.rar).Interphase
E
3

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

Emilyemina answered 15/12, 2021 at 12:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.