Importing Blender Animations

Needing help with Blender here…

I’m pretty new to UE4 and currently have problems with some essential understandings. I managed to import single animation, but now I wanna go for different states my model can go through.

Therefore a simple project - I have a rigged catapult model, and I want to animate it with different states.
I have those 4 simple animations:

  • Loaded (Idle)
  • Unloaded (Idle)
  • Fire (goes from Loaded to Unloaded)
  • Load (Goes from Unloaded to Loaded)

In this tutorial here there is one FBX file for each animation. Wouldn’t that make me save information like the catapult mesh multiple times, making it redundant? Isn’t there a way I can put all animations into one FBX file?

How would I save these animations in Blender?
Just add my keyframes, save the first animation, then delete them all and repeat for each animation?
I’ve read something about so called “Actions”. Isn’t that basically putting several seperate animations into one blend file? Does that work with UE4?

How would I import them in UE4?
Doesn’t importing several FBX files containing my animations also import the catapult mesh again and again?

Is it maybe even possible to animate my armature directly in UE4? Or should I stick to Blender?
Also how would all that work with the wheels of my catapult, if I want it to be able to drive?

Thanks in advance!

No. Just export twice. First just the skeleton mesh without any anim. Second the anim without the mesh. At import in UE4 import the skeleton mesh first and when you import the animations (without the mesh) just choose the already imported skeleton from your skeleton mesh. There is no need to import the mesh again and again.

Depends. If you would just do some rotations it might work in UE4 as well. However animations from Blender works well. In my opinion it’s easier to animate in Blender.

There’s a VehicleMovement component that could be added to your BP. You have to choose which bones should be used for the wheels for that VehicleMovement component. Afterwards just add the WheelHandler for your AnimBP like it’s done in the Vehicle template or the VehicleDemo game.

Thanks for your answer!

So should I basically export/import everything seperately? Mesh, armature, every single animation, and so on? Even textures?

I guess it would indeed make things easier in UE4…

The skeleton mesh should contain the mesh and the armature and could even contain some textures to start creating materials in UE4. But use a second step for the animations. You could skip the animations either at export or import. If you import the animations at the second import choose the already imported skeleton as reference. If you would fix some weightpainting or add a bit more details later it’s easier that way… because you have to import only the mesh again but as long as you don’t touch the armature you could ignore all the anims (they are still fine). If you would fix some anim it’s easier either as you don’t have to import the mesh again.

Thanks for your help!

I’m still kind of confused of how this would look like in Blender…

All animations would be saved seperately, choosing only the armature to be exported with. The mesh (my 3D model) would be saved together with the armature. What if I want to change my animations now when I only have them saved as fbx without a model? I don’t seem to be able to import it back into Blender correctly, let alone see what my animations do, because there is no mesh.

And I still don’t get how people work with Blender’s Actions… I thought of this like a simple list of all the animations I created. It just won’t let me use it like that…

Why is this so vague, why can’t people be more like programmers and seperate things… model, armature, animation…

EDIT: Tried exporting it like I said earlier in this post. In UE4, when importing the animations, it lets me select a skeleton to work with. Then UE4 somehow imports several versions for some of my animations… I think it has to do with the order I save them, and with the Action corpses left in Blender… It really is a hassle right now… I’m usually a very capable worker on PC but I can’t find any logic in this! Looked for tutorials too but none of them can help me with this particular problem >.<

I’m usually using this settings: New project released by MakeHuman team leader - Community & Industry Discussion - Epic Developer Community Forums

You don’t save them as fbx… you just export them. You could leave your mesh and your anims together in Blender and save as .blend file of course. Just skip the mesh at export when you export your anims. You could even choose to export the mesh together with your animations from UE4 if you open them in Persona (even if you imported them seperate previously)… but usually you would not do this if you use Blender because the fbx importer of Blender is weak. Blender is a good output pipeline for UE4. But import from UE4 backwards in Blender should be avoided. You could export static meshes from UE4 import them in Blender and screw them together (to avoid overlapping UVs that happen if you just merge them via UE4) and reimport to UE4 just fine but everything with bones usually looks bad (you would get weird rotations of the bones, no accurate stop, …). If you really have to export animations from UE4 backwards in your 3D app then don’t use Blender but get Maya (LT) instead. If you don’t have to export from UE4 but just import (which usually should be enough) then just keep a blend file that contains your skeleton mesh (without an anim) and if you would animate something create a copy and start your animation progress.

Thanks! That link was insanely helpful!

So I managed to get both version working:

  • exporting the mesh, armature and all animations together in one fbx
  • exporting the mesh plus armature, and then every animation seperately (like you suggested)
    If set up properly, both versions work when importing them in UE4.

Now I don’t actually know what would be best for animating a catapult. This catapult should have 2 states and 2 moves. So I know the idle animations for the demo character, but my catapult is not breathing, it’s just standing still. Should these states be animations themselves, or is there another way to do this?

I’ve seen a video about Matinee. From what I’ve seen I think this rather is a thing for statics like doors etc.

Sorry for all those questions, but I want to be able to make and understand these things as clearly as possible so I don’t mess things up later on…

If it moves via wheels then probably take a look at the vehicle template. The wheels are actually no keyframed anims (but you assign which bones are used by wheels and plug some special node in the anim-bp for that purpose).

Regarding your “door-like” states. There are various ways to do this. You could try to do something with animmontages or if you just would rotate something without any anim at all (but just rotating the components directly in your blueprint). However one easy way doing this would be an anim-BP with a statemachine and 2 anims (door only 1).

Statemachine (states): Entry -> Tensioned -> Fire -> Reload -> (back to Tensioned)
Tensioned state: No anim (assumed the restpose of the catapult is tensioned and ready to fire). You could even set a 1 keyframe do nothing anim here if you feel better or would blend for whatever reason in the transition paths. The transition path to “Fire” should be taken if some variable is set (e.g. some fire bool variable).
Fire state: Should play your fire anim non looped and end with your unarmed idle pose as last keyframe. The transition rule to “Reload” should only be taken if somebody sets the catapult back via some other variable (e.g. reload bool).
Reload state: Should play your tension/reload anim (or if it’s a door just the reversed open anim via -1 as playrate to close the door). The transition rule from “Reload” to “Tensioned” should only be taken after your reload anim is finished so you could use some “Time remaining (ratio)” node to take care the anim is finished before it takes the route from tension to tensioned. If you played an anim at a state and don’t take a further transition route to somewhere else and the anim is non-looping then it just stops at the last keyframe. So if you don’t enter some “breathing” loop state it would not breath :wink:

Ah alright, I’m slowly getting to where I want to (which is basically UE4 know-how :))…

Thanks for your help! Let’s see if I run into any other problems :stuck_out_tongue:

When I export my animation from Blender(without any mesh/armature only) then while importing in UE4 I use the previously imported skeletal mesh. But when I preview the animation, it plays the sequence but there is no mesh there and I can’t see it.

does the skeletal mesh you imported have the mesh assigned to it / the catapult? A screenshot of your content section with the skeletal mesh of the catapult selected would help here. Also of the anim.

As far as the setup goes, a catapult moves slow enough that you don’t need to animate the wheels if you use the vehicle component. you can literally set it up as you would a car, without giving it any controls as far as engine or any movement in BP and the character should be able (if simulate physics is on) to push it around.

For the animation states, it depends on how simple/hard you want it to be. and what kind of catapult we are talking about.

Even on a Trebuchet the bending of the main arm you get is so minimal that you can totally fake the whole thing by just rotating bones and not using animations. To do that you would set up bone rotation nodes via SetBoneRotationByName by benchmarking your max/min and timelining a “load time” a “release time” etc. and simply calling the different events in BP when you need to “throw” stuff.
For the projectile, I would find the apex rotation / point of launch, and spawn the projectile if/when the rotation is = to this number. And actually, you could set it up to throw real stuff with real physics. I have managed this before, but it’s a lot easier to use the projectile class.