3
\$\begingroup\$

I'm trying to figure out a workflow for preparing character animations for Unity so that they are all combined in a single FBX file. The advantage as far as I see it is that it then uses only a single skeleton where multiple animation files would each have their own skeleton (which I think is unnecessary and would increase size considerably).

I've tried using Maya for this but haven't been successful so far. Then I tried Motionbuilder and I can get the animations (takes) together into a single file but many of the animations don't look right afterwards.

So I was wondering does anyone know of a solid workflow to achieve this? I'm having a hard time finding information about what I'm trying to achieve. This is probably a piece of cake for experienced animators but I'm just starting with animation now.

So how do you combine several animation FBX files into single one (whith either Maya, Motionbuilder, or 3DSMax) and make sure that the animations are all properly retained like they should? I'm sure there are some additional things to take care of but I don't know exactly what they are.

\$\endgroup\$
  • \$\begingroup\$ You mention using only a single skeleton. When you make a second animated model, you can use the animation of a different model (I do that in blender+xna), but the second model also needs its own skeleton. This is because each vertex needs to be tied to a bone in that skeleton. So the second model can be made without animations, but has to have a skeleton. But really, the skeleton doesnt take up that much space. The animations do (because you need a lot of them) \$\endgroup\$ – Peethor Oct 16 '15 at 5:19
  • \$\begingroup\$ Thanks for the info Peethor! But for example in Motionbuilder I could import several animation files which then are handled as 'takes' in MB and they share the same skeleton. I would suppose that this is a more optimal workflow than having an identical skeleton in every animation clip (regardless of file size)? \$\endgroup\$ – BadmintonCat Oct 16 '15 at 5:37
  • \$\begingroup\$ Since I never worked with animations in maya or 3DS, I don't know anything about a workflow in that. However in blender, an FBX file can contain your mesh with a skeleton, and multiple takes (or as blender calls it "actions") for that skeleton. In my workflow, every character model has a skeleton, but only one has a bunch of animations. In my code, I use those animations to manipulate the skeleton of the model I want to animate. \$\endgroup\$ – Peethor Oct 16 '15 at 6:02
3
\$\begingroup\$

I'm a bit late on this, but perhaps you can still use it or someone else might come across it.

Exporting

First of all, if the animation look wrong when imported into your game engine, it can be a good idea to bake your animation before exporting. Animation baking can also be done during FBX export in Maya, however I'm not sure it works as well as baking in Maya beforehand under Edit > Keys > Bake Simulation.

Using an extension, you can also setup clips for FBX, which is how you could then have all your animation in one Maya file and similarly export it one, see this link.

If you prefer using Motionbuilder for combining the clips and the re-exporting, try baking the animation before exporting.

Setup in Unity/Game Engine

Now for optimisation. I'm assuming you're using Unity based on other questions you've asked...

AFAIK, Unity will handle optimisation if you name and use it correctly. Let's assume you have a character called Soldier. What I would then do, would be to import a simple T-Pose of this character with no animation on and name the file Solider.fbx. For the walk animation I would name it Solider@walk.fbx, jump Solider@jump.fbx etc (see documentation here).

This Unity will only use one file and the model avatar, and only use the animation from the other files and apply that to the avatar. It doesn't import a new model and skeleton with each fbx file you import. See the documentation on Creating the Avatar and their video tutorials on the subject on Unity's website.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.