12

I'm having issues being able to import a bone and skeletal animation from Maya to Blender to iPhone. Here's what I've done:

  1. install the ColladaMaya plugin to export a DAE for Blender to export
  2. used Jeff LeMarche's script to be able to export a single keyframe of the model and import this .h file into the iPhone game
  3. Setup the GLView using more of Jeff LeMarche's steps and rendered into our Game, so this model display next to the actual game (not in 3D).
  4. Researched oolongngine, sio2 (applied but haven't yet gotten e-mail back from them), other SO q's for solutions, including mine from game dev
  5. Reviewed using FBX SDK content pipeline to dynamically generate class files for the animations.

I can import a model and display it. A lot of these processes respond to that issue and leaving the developer to manipulate the game object programmatically. My main issue is finding the best, defined process of importing an animation into iphone next to the existing game? I don't need a whole game, or a whole scene, just one animating model and some steps to follow.

This animation is meant to play in a loop. There are 3 more animations that will play on different game states (good move, bad move, etc.). So I'm concerned that LeMarche's keyframe solution (which basically means exporting EVERY keyframe as a .h file) will be incredibly time-intensive and memory-intensive. I'm definitely willing to do it, but after all the research I've done (additional links not included), I'm lost as to where to go next besides hand-exporting each keyframe and importing them.

EDIT:

I've added a bounty to this for anyone who can give me a clearly-defined process for importing an animation from a 3D application into iPhone. NOT the entire application itself (i.e. Unity, Sio2, etc.), but just showing a 3D overlay in an application (like an animating model next to a bejeweled-esqe game, not interacting with the world.)

People keep saying, "create your own model loader". Are there scripts, examples, tutorials, anything that walks through this "model loader" process from EXPORTING from the 3D application (preferably Maya or Blender) and IMPORTING this animation and rendering it in Objective-C?

Community
  • 1
  • 1
Dominic Tancredi
  • 41,134
  • 7
  • 34
  • 50
  • Off-hand I would also suggest exporting all the keyframes of your model. The amount of memory will most likely not be that much of an issue, assuming that your model is not composed of thousands of vertices. Animating the model programmatically might be an option for simple animations (rotations, transposing,...) but when it comes to more sophisticated things, I would rather use keyframes than building a full-fledged engine to get the job done. – Till Apr 14 '11 at 19:25
  • Each animation is 45 frames. I'm not even sure there is a "keyframe". So that's the best I can do? – Dominic Tancredi Apr 14 '11 at 20:15
  • Regard each frame as being a "keyframe" and export all of those frames into your app using the options you already learned about. – Till Apr 14 '11 at 20:21
  • I'm working on doing it this way: exporting individual .dae for blender to import and then export as a .h. It's creating 1 MB .h files and involved me having to select the entire objects on the blender stage, join them, and export. 45 frames at 1 MB each is a PITA. – Dominic Tancredi Apr 15 '11 at 20:42

3 Answers3

3

This is really a big problem with animation export. I had this problem recently and ended up with Assimp.

However it also has problems with skeletal animation exported from Maya and Blender. As for me I prefer 3Ds Max (don't forget to reset Xform before rigging), it has no problems with Collada and animation.

Though if you want to use that models in your game I suggest you to write your custom exporter for Maya or Blender. Also try the mesh (morph) animation. If you don't use inverse kinematics or something like that this is what you need.

Max
  • 16,679
  • 4
  • 44
  • 57
1

I have written code that reads Blender files and parses the mesh, bone and animation data. It then applies the bone animations to the meshes world transforms etc. It's a lot of work, but certainly doable. If you have any questions about Blender peculiars, just ask me.

The other option is using a library like OgreKit, which can read blend files and does skeletal animation for you as well out of the box.

Steven Kramer
  • 8,473
  • 2
  • 37
  • 43
  • Ok, do you have this code open-source or available? Can I see an example or tutorial on its usage? Or should I PM you? – Dominic Tancredi Apr 19 '11 at 23:09
  • OgreKit does contain a quite reasonable Blender file reader that you could use as a starting point. – Steven Kramer Apr 21 '11 at 08:45
  • Actually, OgreKit has two different Blender file parsers, and a small lightweight animation system as well. It runs on iPhone, next to Windows, Mac OSX and Linux. The .blend importer has almost no dependencies on the rest of the project, so it should be easy to re-use. See http://gamekit.googlecode.com – Erwin Coumans Apr 22 '11 at 00:50
  • Yeah, that's why I mentioned OgreKit/GameKit in my answer. By the way, thanks for your (and Charlie's) great work Erwin! OgreKit/bParse/Oolong have been great resources. – Steven Kramer Apr 22 '11 at 07:16
  • @Steven Kramer hi, i'm currently work under animation import to openGL from fbx file, so if u can share some useful link/resource for begin - this will be very useful for me, honestly documentation provided with adobe sdk for reading fbx good but not for beginning to work within – hbk Aug 11 '16 at 14:09
  • @gbk Try Ogre sources for Blender, not sure about fbx. – Steven Kramer Aug 23 '16 at 11:20
1

AnimKit is a small animation library that can read a .blend file and play an animation using Glut. It extracts all data for skeletal animation and more, including bones, mesh and animation channels etc from a Blender 2.5 .blend file.

AnimKit is open source (using the permissive zlib license) an you can check it out using Subversion:

svn co http://code.google.com/p/gamekit/source/browse/#svn%2Fbranches%2FAnimKit AnimKit

AnimKit doesn't run on iPhone yet, but I'll port it soon, using Oolong Engine.

Another interesting resource is Proton SDK (protonsdk.com) it has a customized Irrlicht SDK that runs on iPhone/Android etc. The RT3DApp sample can play an animation.

Erwin Coumans
  • 1,766
  • 14
  • 22