Importing multiple animation assets (@ method)

Hi there!

I tried to import .blend, .fbx, and .obj files called like that:

player.blend
player@idle.blend
player@walk.blend

(or ending with fbx, obj respectively)

…and it doesn’t look as if any animations get imported. I just see the mesh in the previews but no sign that the “player” object assembled all animations automatically as described in the documentation.

Would there be any visual feedback anyway to show that animations are added to the first object, how they are named, and how long they are (# keyframes)?

Cheers,

PiLLe

You should see a panel called FBX Importer in the Inspector for the main object (ie, the one without the @ signs in the name). All the animation takes should be listed there, with start/end frame numbers.

Weird, I’m only halfway there.

I re-exported all as .fbx (also imports faster) but this time with meshes (not only animated bones) as posted somewhere else in the forum. Now I see a list of animations in my main “player” object’s Animations section greyed out:

  • DefaultAction
  • DefaultAction.001
  • idle
  • run
  • walk

I can preview the animations and they look ok, but they still not seem to be referenced from the script. The “DefaultAction” and “DefaultAction.001” animations seem to be copies of “run” and “idle”, respectively.

To avoid mistakes when accessing and playing animations I replaced the 3D Platformer Tutorials Lerpz character by my “player” object (skinned and coming with the three mentioned animation files: idle, walk, run). But they don’t play at all. The character stays in its default T-pose.

Any ideas?

Cheers,

PiLLe

No need to export as fbx, blend files work fine. Also, you don´t need to use separate files with each animation, you just need one blend file with all your animations. Each animation should be built in an Action, Unity will understand them all automatically.

As for replacing Lerpz, look at the scripts it uses and search the actual names of the animations they are expecting to find in your model. I did the same some time ago and I remember the names were not exactly the ones you are using.

First of all thanks for the replies!

@GusM: About the animation names:

The animation names seem all right (apart from those automatically created “DefaultAction” thingies). But not even the idles plays. Do they refer to the next object within the refering script’s hierarchy? I.e. to my own “player” object linked below the top-level “Player” object?

What could cause a problem is that I didn’t define replacements for all animations, so maybe the script fails silently when it can’t find some of them?

I also noticed that the “Copper” has some animations called just like Lerpz’. When you open the top level “Player” object’s animation list drop-downs it offers multiple “idle” animations (Copper - idle, player - idle, Lerpz - idle) so it looks as if it could go wrong when you use e.g. the short ambiguous animation name “idle”. Or is that very list actually there to map short names to actual animation resources?

About the different animation files:

That’s just because of my animation workflow. I don’t want to concatenate the animations in one file since it gets messy at one point if animation lengths change or animations get removed/updated. Gets even messier when all the helper objects or other animation specific setups are in one file. :confused:

But now that you mention it: Is there a batch script or tool to put them in one file at or after export time?

Cheers,

PiLLe

The hierarchy and components of your replacement model once at the scene should be exactly the same than Lerpz is using. You need also to put the exact same names to your animations, as I recall all this is hardcoded in the controll scripts. And you also need to have a minimum of the animations used by the system, I don´t remember how many nor which ones now, but they were more than just 3. Open up the scripts and search for them.

In Blender, each animation is done in a separate Action, with different names, times and keyframes. You can always change one without affecting the others. It works just right. Unity will read each one as a separate animation and list them as available automatically, no need to set them by hand.You have 20 layers for 20 different objects there too, use each layer for a different object or group of them. You will gain a lot of controll over your models this way, try it :wink: