Frame at 0.00s

Hey there and welcome back. My name is Sir and in these videos we're going to take a look at working with animation data inside of Unreal Engine and we're going to do that using the new ACOM animation sample project which you can download on Fab today if you want to follow along. Now if you're just joining us this is the second set of videos in the series. In the previous class we looked at the project overall, got a sense of levels, level sequences, things like that. But in these videos like I said we're going to look specifically at working with animation data and in this video we're going to talk specifically about animation sequences and live control rigs and the differences between working with each of those options. So here I am in the production. I am looking at the full sequence here. We got our characters running around, and I'm currently loaded into the full master level with this entire environment that I can fly around and check everything out. But for the purposes of these videos, I'm actually going to leave, hit control N, and go to a basic level where there's pretty much nothing going on. Now, I can still load that same animation sequence right here with the full edit of our production. and what that's going to do is it's going to populate my scene with just the assets we need for animation. I can still jump into my camera and here we go. I'm in that same sequence right here with the characters. Now I'm doing this just to show you that you don't have to work with everything all at once if you don't want to. In this case it can be a nice help to not get distracted by all the cool lighting and effects and things like that. And for the sake of this tutorial it'll just make things a little bit clearer of what I'm doing. So I'm going to go ahead and double click into shot 40 and you'll see the structure of this production overall has a few different sub sequences inside of each individual shot. For one, I'm going to jump back into my camera. You can see that we have a few different animation sub sequences. In this case, we have baked animations, which we go inside here. We'll find each of the characters that have been animated right here. For example, I can click on beta and here is the main anim beta character rig. Now he's not actually being deformed by a control rig. He's being deformed by this animation track, which has an animation sequence in it, right? So this track right here, if I go ahead and mute it, gone. That is the animation for this character that is deforming the model. And that's what's causing our character to run around. But we actually do have the original rig with all the original keyframe data on this character's control rig. So if I go back up these breadcrumbs to my shot sequence from here. I can take the baked animation and I can mute that. I can just turn off the baked animation and instead I can go to the control rig layer here and unmute this. Now I get pretty much the same thing. I can hit play and see the characters running around, but there's a slight difference. You'll notice the tail on this character on gamma is actually moving around and that's because the control rigs themselves don't have all that data baked down. They are live and active control rigs. So if I double click into the anim work subsequence, not only will I find beta and gamma both inside of here. But if I twirl them open, I'm going to find the beta control rig, not an animation sequence. And if I look inside here, here's all the keyframe data that was actually used to animate these characters. So if I click on beta control rig, it'll actually kick me into animation mode, top left corner. I'm now in animation mode and I can see the rigs on these characters. I can toggle them with G for game mode, just in case you can't see them. That might be what you need to hit to bring them back. But these control rigs are only going to show up if I'm in animation mode, which is why selecting this automatically puts me into animation mode. But from here, I can now see the original data for any control that I click. I'll select that and I'll come over here to my curve editor and that'll show me the individual graph and curves for this animation. Now the reason I showing this to you is so that we can check out the two different ways that we can work with data typically inside of Unreal Engine They not the only two ways but with a keyframe animation workflow in mind these are the main two ways that you typically find yourself working in So if I come back out this is why we have the control rig subsequence, right, which is the original animation file, and then this data was baked down into the baked animation sequence, which gives you these basically pre-made clips of animation that can easily be loaded, used in blueprints, all kinds of cool stuff. So let's talk about what we can do with these two different options. Now I'm going to show you how to take live animation data and bake it to a control rig, or sorry, bake it to an animation sequence rather from a control rig. So I'll go ahead and select the AnimWorks subsequence. I'm going to go find this animation and let's make an adjustment. Let's make a tweak to some of the data here. If I click on the body control for beta, our character running around here. I'm going to go to my sequencer curve editor and I'll specify the up and down, the LZ. So that's location in Z space, up and down. And if I want to make his run a little bit bouncier, I could just take some of this and I could scale with control T. I can go ahead and just make this to where he jumps up higher, comes down lower, boom, boom. And then maybe I want to have him squash and stretch a little bit further. So here when he goes to squash down, I'll just pull these curves down and now he will squash lower and then jump you don't have to make that exact change but just to show you that i can modify this rig live i can play it back in real time these are some changes i can make now i'm going to go ahead and just go back to my sequencer and i'm going to select this character in the sequencer now i'm not going to click the controller itself i'm not going to click over here on the right i'm specifically going to right click on the actual skeletal mesh track here where it says beta. I'll right click on this and I'll say bake animation sequence. What this will do is it will actually take all of the animation data on this character and bake it into one of those pre-made little clips that I can use elsewhere. So I'll go ahead and just navigate somewhere in my project to put that. Since I didn't make a specific spot for it, I'll go into the developer folder and if I twirl this down, here I have the me folder. Now this will probably say your name under the developer folder. Me is part of the username I use on my computer, which is why it says me and not sir or sir Wade. But I'll go ahead and just leave that right there. And I'll title this as underscore beta underscore run underscore v1. And that stands for animation sequence underscore, then the character name, and then the action version one. That's my preferred naming convention. You can do whatever you'd like to do, call it whatever you'd like. But this is how I like to do it. I'll go ahead and hit okay. And it will ask me a few different questions of settings. For now, I'll go ahead and just leave everything at default and just say go. Now, right off the bat, that should do it. If I go ahead and go to my content drawer, bottom left corner right here, I can now navigate over to the content folder. The developer folder will now have my personal folder. And if I double click and go inside there, here we have the animation sequence underscore beta run v1. Now, it has a little star on it because it's not actually saved yet. it's made the file, but it's a temporary file. My recommendation, always save that immediately. Just select it, control S. Boop. Now that file is saved. So if I were to crash, I don't lose that file. Now, if I double click on it, we can actually check out the animation and there he goes. He runs a little bit far away, but there he is. He runs around. He has a little bouncy run and he does the jump So this animation sequence is now a pre clip of animation data that we can use in any shot for this character So to show you how that works I going to go ahead and just close out of all of the sequencer stuff here Just close the sequencer leave that entirely I'm now in my blank level. There's nothing going on. And we can start from scratch. So I'm going to jump into my content folder and I'm going to right click anywhere and just make a new level sequence. I'll call this level sequence ls underscore anim underscore run just because and animation run. Sure, why not? I'll double click on that. And now I'm inside of that level sequence, right? So I've got nothing really going on in here. And I want to show you what these animation sequences can do. So I'm going to go ahead and jump back to my content drawer. I'm going to go find the character himself, which is under content, assets, characters, beta, rigs, and I'll find that beta skeletal mesh. So that's the path all through here. I'll go ahead and just drag and drop this and I'll put it straight into the sequencer. Boop. and that will put beta here at origin, chilling, hanging out in his A pose. Now, I'm actually going to do two things. I'm going to select this character. I'm going to hit control D. I'm going to duplicate him. So now I've got beta one and beta two. I'll just put them next to each other. And I'm going to do two different things. So with beta one, the first guy, I'm going to use this animation track right here. If I click add to the animation track, I can pick an animation clip or an animation sequence to use on that character's track. So if I just type in run, I'll find the one that I had named. AS underscore beta run version one. And I'll hit enter. Boop. And now the character is going to disappear. He's way over there. The reason he's over there is the character controls that were being animated originally in the shot, the character had been placed somewhere over here at origin originally. But then all the controls, there had been an offset applied in the animation data. And he just happened to be over there. So that change, why he's over there, that's just based on the original data being offset from his origin location. We can also move this. So if you say, oh, I don't want him floating, I just put him on the floor. And there you go. And there is our animation sequence, right? So all of that animation, good to go, doing his thing. He does a little bouncy run, squash and stretch, and we're good to go. Now what I'm going to do is I'm actually going to take this animation track right here, copy, and I'm going to paste it on beta 2 right here. Just paste, copy, paste, easy. And you'll see here that the characters are actually in slightly different spots because I just moved one of them. I didn't move the other one yet. And so if you want to move both, you totally can. That override is currently being managed by the transform track. Go ahead and set them right next to each other. Because you'll notice each of these characters, beta 1 and beta 2, they both have an animation track, which both have an animation sequence, and they both have their own transform values. And that's currently the values that, you know, moving these things around, that's what that's influencing. This right here, that's my transform track. So why do I have two of these? Well, because one of them is going to stay in animation sequence. The other one, I'm going to switch back to a control rig because this is one of the really cool things about Unreal Engine. So I'll take beta two, this guy on the right, and I'm going to right click on beta two. Now, before I was able to take a live control rig, right click on it and say bake animation sequence, but now I'm going to do the reverse. Using what's called the backwards solve inside of the control rig. It's just one of the features built into these rigs. I'm going to use bake to control rig, and I'm going to select specifically the beta control rig and it going to reverse solve or backwards solve the data that being fed into the character And it going to figure out the animation inputs on the actual rig controls So as soon as I come in here and say go it going to create a rig for the character and we have basically all the same animation going on these rigs. I'm going to go ahead and also just trim this shot so it's not going quite so long. There we go. That way now it loops a little bit better. But you can see I now have these characters both doing their thing. One has a rig, one is just animation sequence. And if I click on one of the controls for this character, I can now see all of the curve data. So if I go to my up and down, there's that familiar curve from before with the up and down bouncy jump. Boom, boom, boom, boom. And that squash and stretch. Right? And so that's one of the really cool things about working with Unreal is you can actually move back and forth from a live control rig to a baked animation sequence and then back again to a control rig should you need to. because sometimes depending on whether you're doing your own keyframe animation, motion capture, if you're downloading clips, whatever it is you're doing, sometimes that's really helpful to be able to sort of just move the data in different directions to change how you deal with various types of animation keyframes. Now, one quick tip I'll give you for these characters. If you look really closely, you'll see that this guy's arms got a little bit funky. This sometimes happens with this rig I've noticed in the solve. You can see that here, maybe I'll do a little comparison, maybe on this frame, you can see that their arms look a little different, right? The animation sequence one, his arm's normal looking. This one on the right, his arm's a little bit weird. I found that if you need to do this conversion and you have this problem, the easiest way to solve it is actually just to tell the arms to solve into IK. And so if we select beta two and we type in arm mid, it will filter for the left and the right mid arm controls of the rig, which are these kind of these elbow area controls. And if I come over here to my anim details, you can see the left arm IK solve, select that, scroll down, and control click the right arm IK solve. We can now basically filter by both of these. So if I go to my curve editor, you can see that we have a bunch of different keyframes on these things. And if I select and turn these both on, watch what happens if I say, turn on, boop, right? That fixes the arms and it will also adjust the value. If I zoom in a little bit here, you can see that I've now changed the value for this particular frame of that solve. Now, that's only the one frame. If we go to another frame, they break again. See, those arms are broken again. So what I can just do is just delete the other values. Boop. So now it's just always set to a value of on. So the left and the right arms are now solved into IK. They have no problems. And we're good to go. So there's the animation. and so hopefully that gives you just a good sense of one of the many features that you get to play with when using control rigs you can take any animation clip and you can right click it in sequencer we go like this any live control rig you can right click on the character and you can bake that to an animation sequence there's a lot you can do with these and if you are already in a animation sequence based animation you can right click on that character you can bake to control rig and then you can bake that to you know any control rig you can have multiple rigs per character. There's so much here to talk about, but that is where we're going to stop for this video. In the next video, I'm going to show you some different ways to work with animation data, especially if you have animation sequences or control rig data, and you want to make adjustments without having to bake and unbake. So I'll see you there.