Unreal Engine - Advanced Animation: Additives

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
all right guys so following up uh we're going to talk about additive additive animations in this one uh so to get started I'm going to explain to you what an additive animation is in case you don't know uh whenever you first start learning how to uh handle animations in an anom graph uh the one of the first things that uh you learn is layered blend per bone and so just to cover that you can add a uh Branch filter or you can use a uh blend mask and you might do something like this with a depth of like four and what the depth means is the depth means how many bones away from uh this bone it will influence uh the animation that's plugged in right here and what ends up happening is uh on when you're learning this it's almost always the case that they play they have you play a lower body animation on the Basse pose and then on the blend pose zero they have you play the upper body animation and it comes out looking like the character is being controlled by two different people where the lower body appears to be moving independent of the upper body it looks unnatural and so that's the reason why we normally use uh additives and so an additive um an additive is stored as Delta so it's represented as as differences between bone rotations between one pose and another pose so a lot can go wrong whenever you're making additives inside of unreal there are there are a lot of nuances uh when working with animations in Unreal Engine right now and I'll try to cover all of them uh but I might miss some of them and I might accidentally make some of those mistakes that I'm trying to uh keep you all from uh do doing inside of here but for every uh frame of this animation it will it will find the difference between its current rotation of say the upper arm r on this one and on this one currently that rotational offset is zero because they're both in the same uh place but if we simulate this and we pause this now on this Frame you can see the upper arm R is in a different place and so there's a rotational offset between these two and you can think of you can think of that like this so let me just uh let me let's just say that this is your Basse pose and this is your animation you want to be additive so so if this is the x axis of the upper arm r then this might be the delta or the offset between the two which is 25 degrees so if we apply that on the anom graph to this animation right here then it's going to add 25 degrees to where it is currently at because of that let's go into play mode because of that depending on uh the offset of that animation we're applying it to the additive will come out looking different and so if we rotate that up that lower arm uh by 45 degrees inwards towards the body you'll see the effect it has on the end result and if we rotate it 45 degrees in the opposite direction you'll see the effect it has on it when we do that and if you if you you want to look and see what's going on you can go to the details and go to skeletal mesh and browse to that animation asset and open it up and you'll see that I'm playing an animation and then right after that on the event graph I'm getting that slider value and I'm applying that as the rotational offset on the X rotation of that lower arm R and then I'm applying the additive animation so that's what's going on there guys so now that you have a basic understanding of how additives work in practice uh let's actually uh uh create one now when we're creating this you'll understand why in the last video the uh whenever I created this animation we had that corrective bone offset uh so I'll I'll go over that and some other nuances as well so let's go ahead and create a third person project and we'll call this additives and just give it a minute so the first thing want to do is we want to remove these walls because we're going to be using a control rig to modify this and it's going to place it right here in the world whenever we do so the first thing we'll do is go to characters folder mannequins animations and Manny and we'll find a pose to do to uh start ours off with so the first thing you you need to know whenever you're dealing with creating assets from the animation editor and baking these to the control rig from the animation editor uh using edit and sequence and C aromatic and body is that the the preview mesh that we have applied currently is going to have a direct effect on it and so the Unreal Engine uh five third person uh template it has it set to the female but that's misleading because all of this is actually set up for the male and so if we go over here and we create an asset it's going to offset things and the legs are going to look funny uh so what we need to do first is we need to actually uh set this to the skm Manny simple if you want to use the uh the actual weapon R bone The skm Man Simple does not have the weapon R bone and you can uh tell by scrolling down here and you can see that it doesn't have the weapon the weapon elbone and that's indicated by that Circle it does not have the corrective bones either it doesn't have the weapon R bone and so those will all if you try to connect something to those it'll be at the origin of the root so uh so you have to be aware of that so let's apply this asset because we're in in our example we're actually going to use we don't need the weapon or bone so we're not going to use that so the first thing we want to do is apply that and then we're going to create our animation from this current pose and so under animations we'll just go ahead and say anom idle [Music] pose and if we do that you shouldn't see the character move if the character moved you didn't do it right the next thing we need to do is we need to go to Rigs and we need to open up the CR mannequin body this is what we're going to use to bake it but we need need to constrain the ik bones it's important that yall guys understand and become familiar with adding these constraints if you're going to be using a control rig at all so the first thing that we're going to do actually is we're going to right click on uh this route and we're going to refresh it and the reason why is if if you uh drop down this pelvis you'll see we have no ik bones that's because when they made this they deliberately selected the ik bones and they deleted them uh I don't know why they did that but they did that on purpose for some reason but let's right click and go to refresh and go to select mesh and we can just scroll down here and select skm any simple and what that does is it'll add those ik bones back into it as you can clearly see here you can remove the interaction uh bone and the center of mass bone since we won't actually be needing those the reason why I didn't use the simple one is because the simple one will give us those but it'll also give us all of the corrective bones as well and we don't need those and whenever you add the corrective bones that's actually what caused that problem I told yall I would tell you all about in the last video with uh the corrective bone being offset during the creation of the or the baking of the animation using the control rig that's actually what was causing that so we need to exclude those actually from this you could actually manually go to refresh and select the skm Manu and then manually delete all those I all those uh Bones from this hierarchy all those corrective bones but in my case and I to to simplify this we're just going to do it this way so the first thing we're going to do is we're going to expand this we're going to shift select the hand gun and the ik Hand R and L then we're going to control select the ik foot L and ik foot R we're going to drag it over here and we're going to set these bones on the forward solver we need to connect these like I'm doing here and then expand these item entries so that we can see what bones they're for and then under the pelvis we're going to select hand L and drag that out over here and say get bone because we want to get the transform of that bone and we want to set the ik bones transform to be that of these bones we're going to do the same with the hand R we're going to get that make sure you connect this don't forget to connect it if you want you can create a control for the ik handgun bone so that you can offset it in relation to that but for this example I'm not going to do that because it'll make it longer than it's already going to be and now make sure you're not using the ball bones uh we want to use the the foot bones so drag out the foot ore and get that and connect it to the ik foot or and now do the same thing with the the left foot make sure you're grabbing the foot L I accidentally grabbed the uh the other one the last time I tried to make this video so I restarted the video and I'm doing it over so save that compil it make sure the ik hand gun and the ik Hand R are set to the the hand R make sure the ik hand gun bone precedes the ik hand R and ik hand L because when the ik hand gun is moved it's going to move these other bones and so we need to have these set after the ik hand gun bone is set so order of operations is really important uh in this scenario for the feet it doesn't really matter so now that we've got that set up we're going to save that and we're going to say edit and sequencer bet to control rig arenicin body and bake now the first thing we need to do whenever we do this with the single pose animation is we need to delete this extra keyed frame on the end that it adds if you don't do that then you're going to have odd results the second thing I always do is always right click on this and go to add section additive and then I zoom out and add one frame if you don't do that then the last frame of your animation will uh pop back to wherever it was on the base after we've done all that uh we can rotate the spine I'm just going to do 20 degrees 10 and 10 oops and then on the head I'm going to rotate that 70 it doesn't really matter you can make it do whatever you want but I'm going to offset this hand normally you wouldn't do that but because he's not holding a rifle and his hand is swinging by his side during the jog animation I don't want that to cause his hand to to enter the body over here the pelvis region so I'm going to offset it outwards if this was for if this was for a rifle Hing animation you would want to offset both of these the same way and so normally what you would do is change these over to ik mode and you would constrain one uh ik control to the other ik control that way whenever you move one it'll move the other while maintaining that offset now that we've created our additive animation we can set it up so we're going to go into our animations folder where we save it and we are going to go to the asset details since this is a single frame animation I'm just going to say step but actually it's really not important so you don't have to do that it's just a habit I like to get into uh also I like to set these to Loop if they're supposed to be looping uh that's not really necessary either but it's a good habit to get into under the additive settings we're going to set this to local space you can set this to mesh mesh space mesh space has a better effect on the body so you can do that in fact we'll just go ahead and and do that in mesh space we're going to say selected animation frame and so before I start I want to go ahead and uh actually explain all this to you what these different things are for so frame from this animation would be if you had say for example for example uh this animation right here is uh I meant to simulate that sorry this animation right here we're actually using the frame from the first frame from this animation uh as the reference so in situations like this where you just want to get that motion itself applied to the animation you you might actually want to Simply use frame from this animation and use the first frame which is frame zero in some cases you might have an aim sweep where it starts off with him aiming up in the air and looking back over his uh and up uh and then it might end with him looking down and aiming down but the center frame might have him pointing straight and so in a situation like that you might actually want to use that Center frame frame uh 15 for example on if it was a 30 frame animation then it might be frame 15 that you want to use for a selected animation frame uh that allows you to select a specific frame and use that single frame as a reference from an animation and so that's the one we're going to use in some cases you might want you might not to want you you might not want to to use a single frame from the animation uh to apply Deltas based off of and so in some cases uh I don't have an example for you but there might be a case where you might want every frame of that animation to be used as a base and so this animation will be playing frame by frame and every single time the Delta off of this will be different since the base animation rotations are changing like I said I can't think of a use scenario for that but I'm sure there is one skeletal ref skeleton reference pose if you made this from the actual uh skeleton uh default pose like this if you actually made that additive from this pose if I say go up here and I go to current create animation from current pose if I did that then and I created my offset my look left from that then I would want to use the skeleton reference pose as the base pose so anyway moving on uh we're going to use the selected animation frame and we are going to go to Manny and we're going to choose mm Idol and we're going to set that and we're going to use the first frame off of that as our reference pose so now we've set it up we're going to move on let's go to the animations folder and open up the ABP Manu we're going to go to anim graph and we are going to drag this out and since we created that as an a mesh space additive animation we need to apply in mesh space so we're going to say apply normally if it were in local space we would apply the additive but with it being a mesh space we want to apply mesh space additive we are going to rightclick on this and convert to single frame animation because this is a single pose so not a full-blown animation uh we're just going to play this single frame from it you can make sure that the should Loop is checked if not it'll play it and then stop uh but yeah so it'll it'll set that by default when you change it to a single frame so if we did all of this right then when we compile it you should only see him looking to the left if the legs or pelvis moved then it's because of uh this foot ik system and you didn't constrain the ik bones correctly so if you go to characters and bones and all hierarchy those bones pointing from the root to the feet and pointing from the root to the hands those should be where the hands and the feet are if they are uh well if the ik is connected they will anyway but just disconnect to that and if the feet move after you disconnect that then you'll know that's the reason why anyway moving on the reason why I offset it when I connect it is because this control rig it drops the pelvis slightly to so that the Fe can reach the ground uh that's the reason why it does that so now that we've done that uh we can play these animations in here and we won't have any adverse effects on the feet or legs uh you'll notice that we don't have any unwanted rotations on them that's pretty much it guys so yeah you might want to watch watch through this video a couple of times because some of those nuances that I went over uh you might have missed them or they might have just not sunk in but if you're not careful you will repeat those same mistakes over and over again so I really recommend that when you're creating these additives do them externally and Maya or blender uh if you don't mind doing that because doing things in unreal as far as animation goes uh a lot can go wrong uh the animation tools and unreal are still under development so keep that in mind and I will see you in the next video
Info
Channel: Unreal DevOP
Views: 1,710
Rating: undefined out of 5
Keywords:
Id: hGalXYF5Hko
Channel Id: undefined
Length: 21min 48sec (1308 seconds)
Published: Fri Dec 08 2023
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.