Unreal + Blender Tutorial - How to add root bones / motion or keep animations in place

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hey guys this is Wojtek and today we're gonna take a look at how using blender we can convert our kik animation so they look a little bit better specifically we're gonna do is we're gonna create a route bone for our 3d character using blender which is a free tool competitor Tamiya and 3ds max that you can just grab and it will allow us to do these manipulations we're then going to take our animation our Roundhouse animation and introduce route motion by creating proper transition States for our route bone and then lastly we're also going to look at hey how can we convert this animation so it doesn't use route motion but rather stays in place so does a slide forwards in a bit to the right the way we're seeing it now so let's get started alright guys so let's start taking a look at how to configure our animation so they just work a little bit better either by using the route motion or adding in route bones to our characters or by doing in-place animations and we'll look at that in a second of how we do all of that in blender but first let's look at the problem so over the last little bit we've been creating these animations and our punches are kind of cool and they work well but then let's look at our kicks so that one's not bad it's in place the character doesn't go very far but this one that a roundhouse you'll notice when we trigger that one which is it's all random but when we trigger that roundhouse he moves forward and then back and let me just show you real quick why that's happening so if we go back to our blueprint for our player character and we go to the capsule component and we set the visibility - oh sorry how not visibility:hidden game so that means the capsule will not be visible while the game is running but here we can see the problem so now bad he stays within the capsule stays within the capsule and then let's see we can there we go so you can see with the roundhouse he slides out of the capsule on them back into it and we have a couple of ways that we can deal with this so we can do is we can introduce route motion which will force the capsule to move with the animation so when he does that the capsule should slide kind of a bit this way towards the right or we have the option of taking this animation which slides out of the capsule and keep it in place and now ways it remains static and it's in line with our our capsule and then if we want to actually show movement during that animation cycle we can do that through blueprints or code and just have the capsu of slide along with it so we have a couple of options and let me show you real quick how we can enable both of them alright guys so let's go into blender and I'm using version 279 but this technique is going to apply to I'm hoping any other versions of blender as well as my 3ds Max and any other 3d tooling you may be leveraging for this exercise but let's look at blender and one thing we're gonna do real quick is just clean up our startup scene because it comes with it's got a camera and it's got this little box and whatever that is but we don't want all this stuff so let's click on the box and delete it we'll leave the camera in place for now but we're gonna make a slight adjustment to our scene presentation as well so if you click the the scene tab what we're gonna do is we're gonna change the length to use metric as its measuring system and we're gonna change the unit scale from 1 to point zero 1 and what this really means is we're resetting the view such that [Music] are seen in our world within blender matches the scene and world with an unreal a little bit better so when we bring in our models there's not gonna be any weird sort of scaling or weird behaviors the reason the grid is also stretched out is cuz I'm not adjusting any of the sort of zoom you know camera and things like that but but that's okay so with our scene configured what we can do is we can say file safe start a file and this will retain these settings every time we load a new version of blender scene so if you say file new real alternative file boom we're back to where we started cool so let's go ahead and create our root bone definition for our T 3d model pose to do so we go to file import FBX and then we navigate to our tutorial directory and you'll notice I already have one here that I was experimenting with earlier but we're gonna go do it from scratch by selecting the kijun JIRA Saleh's tipos which we downloaded from mixable another double-clicking or clicking the import FBX button in the top right hand corner but there she is there's all her bone definitions cool so all we're gonna do with this T pose is basically rename the armature component to route so to do so you click the armature setting which if you expand it out in the scene preview window there contains the pose the animations the various bone definitions and a lotta stuff and we'll deal with this in a second but let's select this guy and then navigate to the object details and we're gonna rename it from armature to route cool so that saves the route component with the name of route and that when we import it into unreal it's you'll notice you'll get recognized almost automatically so we're done with this guy let's get a file export FBX and one thing you need to worry about when you're exporting your FBX files is the orientation so the forward because again to match it to the world space of unreal you want to set it to minus y forward with the Z being up Z Zed now if we go back to our project we're just gonna save this as the route t O's alright cool so we're done with this part of the tutorial now let's go back to unreal so with unreal open we're gonna create a new folder and we're gonna call this mixin import just to not clutter the rest of our files and then we're gonna take in our route T pose and we're just gonna drag it right in so on the import window basically we'll leave everything defaults so we want to bring the scheduled skeletal mesh the import mesh we want to leave the skeleton that it assigns it to as empty because we want unreal to create a net new one and disregard to anything around the transforms and the animations because we're not we're not doing any of that right now so import and when you get this morning disregard it again what it means is hey the thing we're bringing in has more definitions than the thing I know about which is the unreal mannequin so you know deal with it and we will so we don't have to worry about this too much now with our character brought in what we can do is we can open up the skeleton and now start hooking it up to a rig and retarget the actual skeleton definitions but before we do that let's just take a look at our skeleton tree you'll notice our root boned which is sort of in the centre of the character right by the floor it's called root and that's because we brought it in from our blender exported FBX file cool so retargeting manager there's a separate tutorial in my set of videos that goes over this specifically around the mix of automation but you can apply this technique again to anything and we're just gonna kind of quickly skim through this so we're gonna select our rig which is humanoid and then because we're you know good scientists and we save things we're gonna click load and we're gonna pull up this mixing oil rig mapping container which was already done in one of our previous tutorials with the only adjustment is going to be to our route definition rather than hips which is what we were doing before we're gonna set this to be route cool so there's our guy and he's remapped and now we can bind animations towards this character model and then re-import them for our unreal mannequin the only other thing we're gonna do is we're gonna click this button here this is applied to asset and what its gonna do is it's going to apply this pose to our preview windows whenever we do re-importing of animations from this guy to our Unreal mannequin and again this is covered in our mixing mo importing video cool so we're done with this guy let's just save them and and there we go so now that we have this saved let's go ahead and convert our animations to reference this this mannequin so to do so we're gonna go back to blender and I'm just gonna create a new scene so following you and it's gonna clean up all this stuff for me then I'm gonna say file import FBX and I'm gonna find my medium right roundhouse fbx so there's our animation and all of its skeletal glory and when we played back using the timeline here you'll notice there's our kick and there's the character kind of sliding off to to the right okay so this is now where it gets a little funky what we're gonna do is we're going to start creating bones or rather a bone for our character that is going to become our root bone definition and to do so we're gonna go to our armature or our bone definition and don't worry about the names you'll see how this all plays out in a second and what we're gonna do is we're gonna hit space then we're gonna say add bone and there's our bone now you'll notice it's sort of in the center of the feet which is more or less where where we want it to be we basically wanted at position zero zero but there's our bone and you know we've got the transform gizmo so you can kind of move it around and do stuff with it but we really want to add zero zero so I'm going to change the translate to zero zero and just leave it there and then what I'm gonna do is I'm gonna pick my hip bones again here on the right hand side or you can select it from from this view here and if you can't get to this for you and it's kind of looking like that well that's the trick change from pose of you to edit mode and you'll get back to this to this view so we're gonna select our root bone and we're gonna shift click on our hip bone so both of them are selected and then we're gonna hit ctrl P which says make parent and then we're gonna say keep offset so oh and I did these backwards let me just back it up so control Z and let's do differently let's do the hips and then the bound then control P and then control P and there we go so our bone our root bone became the parent of our hips our spine our left leg and our right uh plug now we're gonna also rename this bone so to do so you can select the bone up here and then you go to the bone details tab now we're gonna call this route and again the more you keep in line with the naming convention of the Unreal Engine the easier it's gonna be for it to auto remember things for you so cool so we've gone to our route bone and let's go back to pose mode and just play this back so you can see from the center there's this little point right here at the bottom and his tail or whatever is kind of stretching out from there then that indicates hey I started here and I move my character some distance away from that point cool another thing you may notice is our animation here hmm it's set to excuse me is set to 250 frames and we're gonna have to change that to 62 because that's really the duration of of our animation so around 62 it finishes so we're gonna change the end to 62 keep that little bit smaller cool and now we can go ahead and start cleaning up our animation graph so this route definition actually works as expected so we're gonna do a couple things we're gonna go to our our animation graph and to do so you can flip either through this little gizmo or this little selection box in the bottom left hand corner to your graph editor or if you want to have multiple panes you can grab any one of these edges these little triangles and just drag it over and I've got two windows so I'm gonna set my left one to be my graph and my right one just to be my animation as I play it back okay cool so we've got that in place now let's go ahead and start looking at our bones so we have a couple things going on here we've got our our hips and you'll notice this stuff turns green or as the root stuff doesn't and what that means is our root bone really doesn't have any keyframes so what we're gonna do is we're gonna right click after we selected our root bone we're gonna right click on this transform section and say insert keyframes and what that means is just right at the beginning we have our zeros your a spot and it doesn't really go from there so let's replace the root bone keyframes with our hip keyframes so if you select your hips on the left hand side here and the graph window what we want to do is we want to grab the x y&z location of our hips disregarding the scaling and the rotation elements of things and to do that you basically click you holding that shift these three sections and then you go to key copy keyframes then go back to your root graph definition and again we're gonna select these three using shift then we go to key and paste keyframes so now when we play this back you'll notice this little pivot point bounces around as our character moves which is which is okay but we don't want it to be we don't want the route to be moving as well as the hips to be moving so what we're gonna do is we're gonna remove these animations from from our hips so let's go to our hips and I'm just gonna click this global visibility link it off we're gonna make this screen just a little bit bigger and then we're gonna go through each one of these guys and we're basically gonna take them down to their very very beginning keyframe so if we pick X you'll notice and I'm just zooming in with the middle mouse wheel you'll notice we have these keyframes and as we move around over them we can see that the X location changes depending on the time cool but we don't want this we want to delete all these keyframes except for the very first one so to do so we're gonna do is we're gonna press B on our keyboard and you can right click on each one of these nodes or if you press B you get these multi selection tool so you can highlight them all and then hit delete and it just leads to keyframes and keep working your way all don't be and highlight everything but the first one so there we go there's our keyframes gone for the X location cool let's do the same thing for the Y so you can go ahead and kind of figure out or you can do them all on one shot there we go and let's now do the Z we've got a couple of these sluice guys here okay so we went ahead and we added the key frames to our rootbound we remove them from our hips and now when our character moves you'll notice has root bound which is almost vertical you know 90 degree down moves alongside our animation and what that's gonna mean is the center of the capsule is gonna line up to this point and it's gonna fly around with these animations as expected cool so one more little thing we're gonna do before we save this and import it back into unreal so what we want to do is we are going to and I'm just trying to find the window for it oh there we go sorry so on our scene we're gonna go to our object details and we're gonna look for this section mocap tools and what mocap tools are is they come from plugin that can be turned off or on if you go to file user preferences and under add-ons if you go to animation you'll notice this section here animation motion capture to us so if you don't see this mocap tool section on your object details within your scene make sure this plug-in is turned on when you do have it on what we're gonna do is we're gonna hit this button here fix BVH taxis and what it does is it course corrects the orientation of your character as it pertains to the animations so if we hit that you'll notice he kind of gets turned around and uh you know weird rotation almost like 90 degrees that way and to correct it on the transform you'll notice there's already a 90 degree turn just set that to zero and they're back up and armor cool so we got to transform or animations work and then our route bomb shoot go along with with all this stuff cool so let's now export our animation FBX and let's call this medium roundhouse rich motion and again make sure your forward is set to minus y and your up is Z export FBX cool let's go back to our project and now bring in this new animation so there we go when I drag in the animation it automatically recognizes our route tipos skeleton which is what what we were expecting and then we've got the usual sort of options we can mess around with as well as you know this came from blender and it's 30 frames a second a lot stuff okay so we'll import it and there's our animation now you'll notice what we're seeing here is the character just kind of doing the exact same thing they were doing before but if we now turn on this option which is an able root motion our character keeps moving forward and here's what it looks like with the bone identifiers turned on so you see there's our root you know she moves a little bit forward into the right it drags that but if we now go back to running route motion she's moving okay so we had this animation in place and now we want to use it within our within our character so how do we do that well if we right click on our animation and say retarget atom assets because we ended up reading mesh earlier we can now just go directly to our unreal mannequin so there's our new animation our root animation so let's go to our kick folder oops I'm just gonna drag that in here and what we're gonna do is we're gonna take this montage and we're gonna duplicate it we're gonna say root kick montage and we're just getting a read of a couple of these things not to freak anybody yeah but I'm just gonna turn off the bone hierarchy so I'm gonna get rid of that we're gonna get rid of that we're gonna get rid of the section we're gonna go to this section we've had one we'll get rid of had three dot okay and we're gonna just get rid of a couple of these notifications because we don't need all of them just just one we're just gonna work on this one kick animation and that's fine we're not really sure yeah yeah let's start down here that's what the sound is gonna play the collisions are always on because we're doing almost the full full animation and there's your medium roundhouse alright so let's get rid of the medium roundhouse and instead bring in medium roundhouse root so this guy here then we're just gonna re align these sections so start is the first one there's end okay and all that is in place more or less 2 2 2 2 then where's that name is around here somewhere that's these guys are on almost for the full duration ok cool so there's our single root kick montage now we're gonna do is we're going to go to our data table and we're gonna replace kick with this new montage so we're gonna say that's and it just has one so now and as you guys can see because we have motion enables on that animation our capsule in our player character moves along with it pretty cool and all of our other stuff still works we're just getting bit closer yeah all of our kicks still work very nicely but we also get this cool little movement of our capsule with our animation so that's kind of it for route motion and if you can if you want to see just what this looks like if we turn this back off we can just go back to animation take out this check box save and there you can see the problem surfacing again in fact because the animation isn't accounting for sort of the offset when I was reporting it it's also kind of slides into the ground so that that can be simply adjusted by upping the the various axis values when you're bringing in your animation but let's turn this back on we're gonna go there we go let's save that and now we're back up and running so the animation tries to stay within the caps use definition and everything moves together nicely our kicks still work our punches work as well excellent so let's now see how we can do the exact same thing by turning this little kick animation into one that stays in place so it doesn't move like these punches okay so to do that we're gonna go back to blender and we're going to re-import our animation import up the X and then let's go to our medium right roundhouse FBX file and now instead of worrying about anything to do with our root ball what we're gonna do is we're simply going to take away those translation details for our hips so we know the hips are the root and we know that when things move that our character slides over a little bit on the on the x and y-axes so let's pop open oops let's pop open a secondary window and let's look at our timeline so let's go back to our armature section down to our hips and just make sure that our hip bones are selected cool and let's get rid of all of these except for XY and z so you'll notice as you slide your marker around these guys this is where all that translation happens and similar to what we did with our Routh motion we can go ahead and simply delete these additional keyframes so if I go ahead and you know I select we were just if I go I had and I select all these keyframes I just weight them then I go ahead and do the exact same thing to all these guys those are gone then repeat the same exercise except for the first one you always want to relieve the first keyframe in place because it kind of determines the starting point of our of our animation so get rid of all those keyframes let's do ours let's just try good where's your sad then let's do this chunk up here cool so there's our Zed all cleaned up and now if we were just slide our our time line around so let's make this a little bit bigger and then go back through our time line definition you'll notice the kick still occurs but no on moves the animation stays in place so let's go ahead and tidy this guy up as well so set the frame count to six and two because that's the duration of our animation and then let's go back to our our seat settings under the excuse me under the options we're gonna again fix the BVH oxys and then rotate it back up by back to zero and now we can export this out so FBX and we're gonna call those the in place rather in place and again make sure your your forward is set correctly export FBX and we're good let's go back to you unreal and they'll bring in this this new animation so there's our in place and let's bring it in so you'll notice it tries to attach itself to the root tebow skill tipos skeleton but if we try to import it it actually freaks out it doesn't like that and it says hey you're trying to import an animation that is not targeted against a root motion or root bones defined skeleton so you know figure that out and we obviously can't import this this animation so how do we fix that well our previous tipos our original character that we didn't modify doesn't have a root so we can use it as our basis for our other animation so we bring that into unreal again let's disregard everything around animations published just bring in this stuff and skeleton should be again empty because we want to be created by default when we bring in this character so there's our other character and there's its skeleton so we're gonna pop in the skeleton go to the retargeting manager and just to confirm our skeleton tree hips is still the root bone so in a retarget manager we're going to pick humanoid rig and then load the mix amalrik again and again it's gonna say hippest hips and hips for the root and pelvis which is what we're looking for save that and just make sure you apply the default T pose for our preview meshes cool so let's now go ahead and bring in are in place animation so now it's gonna say well what skeleton do you want to use well we know that the root T pose is no good we know this guy's good but he's not mapped yet so let's bring it in to this guy there we go we got the same warning saying hey you have a bunch of hand items that are not mapped to anything on your mannequin let's disregard that but there's our in place animation and you know in a motion it's all messed up because she has no idea how to do Rube motion anything so I'll take that off close this down and then say retarget Adam said so now we're gonna go from our in place animation to our mannequin retarget and there's our medium roundhouse in place so we're going to make this guy over to our kick as well so there it is we now have an in place one oops an in place one as well as our Russian one and let's do the same thing so we're going to take this montage we're going to duplicate it in place kick over time okay there's our in place kick montage and what I'm gonna do is I'm going to take this animation toss it and bring in our our in place one now which one is it let's get here this guy here no too far there we go and let's just readjust the start and the end there's your end let's readjust this guy that's right I think around here there's one where all the sounds okay so there's our in place montage let's save that go back to our data table and modify our kick to use our in place kick montage save that and play so now when we throw a roundhouse he doesn't go anywhere and this is where we can get clever and adjust our actual you know capsule movement to fall along whatever the animation is doing or we can just leave it as is now again you'll notice the animation floats up because I haven't brought it down and I was importing it you can check out those values as part of the mixable in port video but yeah there you go guys so we have our in place animations we can very quickly flip them over to our root motion animations which now move the whole capsule with with our player and then lastly we can go back to our broken as random kicks that kind of sort of do a little bit both so there's in place in place in place oh sorry it's only doing one because I only set play back the first animation there we go there's our broken ass state cool so I hope this helps and I look forward to seeing you guys next time [Music]
Info
Channel: Jolly Monster Studio
Views: 28,919
Rating: undefined out of 5
Keywords: unreal, engine, root bone, root motion, blender, mixamo, in place, animation, unreal engine, ue4
Id: YuIUrKNw52M
Channel Id: undefined
Length: 38min 41sec (2321 seconds)
Published: Sun Dec 30 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.