• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.
Sign in to follow this  
Followers 0
spek

Importing animations from FBX files

8 posts in this topic

Is it just me, or is the FBX horribly confusing?

We need to export animations from Maya or Blender, so I tried FBX and Collada for that. Reading meshes and stuff from these file format's is not a problem, but things get really blurry when it comes to joints, keyframes, et cetera. I gave up on Collada a long time before, and tried FBX, using Autodesk's (bloated) SDK.... With success! Until now...

 

One of the guys used Inverse Kinematics in his animation. But since I don't know how to handle that, we looked for a way to convert IK back to FK animations. Thus having 0,1 or more keyframes per joint that describe a certain rotation or transformation.

 

Problem is that I don't know or have Maya, nor some other program that can import animated FBX models. But I guess the "Bake animations" option in Maya's exporter is needed. Don't know if the guy who is exporting the model did strange things, but basically I had 3 different results:

 

- No FK data (no "eSkeleton" nodes to be found)

- A half animated model. Some of the joints seemed ok, others didn't move at all 

- A HUGE (500+ MB) file containing, well, I dunno. Lot's of keyframes or something. Couldn't process it

 

 

 

Apart from that, some models had a mesh, or a bindpose, others didn't. Really @#$%@ annoying that there are so much differences, and none of them worked. Now to the questions:

 

1- Are there particular DO's and DONT's in Maya and its exporter?

2- Does someone have experience with the FBX SDK?

Maybe I just made a stupid code bug or missed some important bits

 

3- Is there a free tool where I can view animated FBX files? Just to ensure the file is at least correct.

Tried "Clockstone" and Autodesks own Quicktime viewer(!), but that didn't work well.

 

4- Isn't there something handier than Collada / FBX?

Even if this succeeds, I'll probably never love them. But apart from Milkshape or outdated Doom MD5 files, I'm not aware of a no-nonsense format that is also supported by Blender/Maya.

0

Share this post


Link to post
Share on other sites

Thanks, I'll read through this after work today, and maybe drop you a letter!

 

I think however, that the fault is not my code part (that's easy to say). When importing it into Quicktime with their FBX viewer, I see the same problems. The animation exported with IK seems ok, but the other "converted" ones are not or only half animated. To put it more technically, some joints simply don't have a curve with translation/scale/rotation elements. Maya or its exporter skipped them for some reason. Or stored it in a very different way.

 

That's what I guess at least. I really have no clue how Maya looks, so it's a shot in the darkness. But the animator tried all kinds of things as well, and each time those @#% FBX files fail.

0

Share this post


Link to post
Share on other sites

Well. I think there is an easy way to tell if FBX's Exporting process messed things up or your code has some problems.

So you have the FBXSDK, right?

Go to its samples, and open the "ViewScene" sample project.

And import your FBX file into that project and see how it is gonna be displayed. If it is still messed up, then FBX is the culprit.

 

I have not worked with curves; instead, I get the entire transformation at time T for my animation, which costs a lot of memory and I need to fix that. But maybe that way at least you know if you can rely on FBX format. I think FBX is solid because a lot of AAA games use it and if it has serious problems like this, no one would use it.

 

And if you want, can you tell me how you get the bind pose matrices?(You said sometimes you have missing bind pose matrices).

The correct way is to use "TransformLinkMatrix" function. If you use FbxPose, there is a big chance that things get messed up.

1

Share this post


Link to post
Share on other sites

One of the guys used Inverse Kinematics in his animation. But since I don't know how to handle that, we looked for a way to convert IK back to FK animations.

This should be goal, the IK influences should be baked to the FK bones. Further on, most IK bones, bones which do not deform the mesh, should be ignored.

 

 

 


- No FK data (no "eSkeleton" nodes to be found)

- A half animated model. Some of the joints seemed ok, others didn't move at all 

- A HUGE (500+ MB) file containing, well, I dunno. Lot's of keyframes or something. Couldn't process it

You should double check the skeleton. It should contain a clear hierachy of deform bones with a single root. Did your college use eg. "bridges", bones which do not deform your mesh and are potentially ignored therefor, but are parent to other deform bones ? He should make some simple test animations like a deforming cylinder (using IKs etc.), export this and give it to you for importing it into the game.

 

PS:

A good rule of thumb:

Make a layered skeleton, first layer are all deforming bones, the bones which are important for the game engine. These should define a clear hierachy including a single root bone. The second layer are control bones which are conntect to the first layer by constraints. The second layer is often the only layer which got animated by the artist, it drives the first layer. Just ensure, that the first layer contains all the (FK) transformations (bake animation before/while exporting).

Edited by Ashaman73
1

Share this post


Link to post
Share on other sites

It's a bit hocus-pocus since I never used Maya, but the double-layered approach sounds very logical to me. Dunno if there are bridges or multiple root bones, but I'll forward that question. But I can see there are some additional (control?) joints. Those don't have the "eSkeleton" type so I ignore them, although I still do traverse its child nodes.

 

@tlang1991

Good idea!

Just tried it, and, not a complete surprise, same results. So I'm pretty sure now the problems start in Maya already.

Edited by spek
0

Share this post


Link to post
Share on other sites


Those don't have the "eSkeleton" type so I ignore them, although I still do traverse its child nodes.

Skipping bones could be an issue, if the bones are related to its parent space.

0

Share this post


Link to post
Share on other sites

Have you already try to use the Asset Importer Library - FBX import feature? I haven't used it now but a lot of your requested features shpuld be already supported by it. And you can use our viewer to verify your models.

 

See https://github.com/assimp/assimp/tree/master/code to learn more about it. And of course feel free if you have any questions regarding this topic.

 

- Kim

0

Share this post


Link to post
Share on other sites

Hi again,

 

Well, not sure if my code is 100% right indeed (so thanks for that link Kimmi!), but I modified the FBX SDK "Viewer" program a little bit so we can load a custom file. Since this viewer shows the exact same problems, I pass the ball back to the animator. First we have to got it exported right I guess. Too bad I have zero insight in Maya, so I just forwarded Ashaman's hints to the animator. Let's hope that works!

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0