Advanced ground matching run cycle tutorial in Blender

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
everyone eric from p2 design in this video i will show you how i've made this animation from the previous motion capture data we have cleaned we will make our character run following the terrain geometry you will learn how to make the fit follow the ground bumps but also how to input procedural leaning depending on the curvature of the path let's get started this tutorial is sponsored by myself if you want to learn all my rigging technique or if you want to create stylized character from scratch you will find all you need on my gumroad page use the code p2 design and get 10 percent on whatever product you want you can use this method on any kind of character it can be a quadruped or whatever as soon as the legs are set to inverse kinematic i will activate the small square icon in the graph editor to make sure all my curves are displayed and i will press shifter e and make cyclic so now my short run cycle will cycle forever i have imported my character into a scene where i've generated a ground using a pair of displacement modifier onto a subdivided plane i will simply add a curve set to basic curve that i will shape more or less into the path i'd like my character to follow so i wanted him to be turning where the terrain is getting a little higher so that we get an interesting shot once i've modeled my path in edit mode i've selected my character rig and i've added a path constraint in the constraint panel just select the curve you have created and enable whole curve if your character is offset from the curve just select its armature and press alt g to reset its location then if needed you can rotate the armature in object mode or tweak the different forward axis option you have in the constraint then select your curve go into the modifier and add a shrink wrap modifier to your curve and target deterring object or ground object note that unfortunately your character won't be following the curve with the modifier enabled he will continue to follow the curve as if it wasn't modified we first need to select our curve and go to object and convert it into a mesh object the curve will be converted into connected edges that we can convert back into a curve by going into object convert to curve from mesh to be able to reuse the created curve we need to reset it to have busy interpolation by going into set spline type and select busy finally we get a very buzzy and noisy curve because there are a lot of controller points so we will need to decimate you can go to curve clean up and select decimate don't hesitate to remove a lot of control point because the noise of the foot contacting the ground will be driven by the ground not by the curve the curve will drive the motion of the torso of our character so then i will set the handles to automatic and i will smooth the path and i will try to keep the curve more or less on the surface of the crown don't hesitate to extrude a bit your curve in the curve option so that you will see it clipping with the ground it will make your life easier whenever you are realign it upon the ground the idea is to try to follow the ground geometry but most importantly try to have nice and broad curves don't make a too noisy curve or your character will lean left and right and will be rotating all the way around and it won't look good when we are done with this we need to make sure that our feet won't be sliding on the ground meaning that we need to sync the animation speed of our character with the curve length in the curve option we can set the number of frames needed for our character to run along the whole curve so by setting it around 150 i will see my character mostly staying on the ground its foot is not sliding that much and then i can tweak this value a little more to get a better behavior now at some point the feet will be clipping with the ground because the character is following the curve and the feet are not constrained to the ground let's fix this to make sure our feet are staying upon the ground we need to use a floor constraint but first we need to find the target so i will select both my feet ik and i will duplicate them and i will rename those bone ground foot ik dot ln.r to make things easier to follow two i will change the custom shape of those two bones by using the root bone custom shape and i will scale it down so that it's easy to identify those two bones when i play the animation we can see those two bones sliding on the ground are staying still they are just following the root bone because they are charged of it as i want to make sure that they will always be under the foot bone i will select the foot bone then dose bone and i will add a copy transform constraint then i will bake the action of those two bones by pressing f3 and search for bake i will set the length from 1 to 18 which is the length of my run cycle and i will bake with visual keying remove constraint and overwrite current action now those bones move exactly as the feet are moving i will now make those cycling i will go into the graph editor select all the curve of those two bone press shift e and make cycle to make sure those newly created bone don't go through the ground i will add to them a shrink wrap constraint and target the ground now the trick is simple instead of neurosurface i will use project onto the positive z axis in word space it means the bone will be projected upward into the global or world space and if there isn't anything to catch it or to clip it it won't move so it won't be using this constraint unless it goes under the ground as there so now i can use this bone select it first then select the foot ik controller and add a floor constraint so the thing is that since it has a copy transform that has been baked it will be at the same eighth as the foot controller unless it goes under the ground and at this moment the floor constraint will be applied to the foot controller so you will see couples of glitches during the run cycle but most of it is nice and clean from there i can weather bake the animation and get rid of the bugging frames or i can use the nla editor just to key the couple of frames that are bugging and use a corrective layer if i go in the nla editor i will be able to see the current action i'm using with my armature which is our run cycle let's push it down onto a new strip to make sure it is read during the whole animation i will go into the strip option and on the active clip i will put the end around frame 150 so now the current strip is playing my base run animation which is cycling during 150 frame i will now create my corrective action by clicking the new button in the action here and i will call it ground corrective and you can see that i have the ground corrective action that is now active in the nla the idea is to set the extrapolation to nothing and the blending to add this way any animation that we will be recording on this new action will be added on top of our run cycle animation the idea is to insert a keyframe before and after any bugging keyframe and then in between move the bone until we get rid of the bug so i will insert a keyframe before one after and in the middle i will just move this bone on the z axis until the shrink flap modifier or shrink wrap constraint behave a little more properly and i will do this on the couple of bugging frames since i feel you're loving what we are doing we can go even further and walk on the heel of our foot and on the toes you will see that it's not that complicated using the floor constraint we just have fixed the position of the roll of our foot currently the head of the bone that is controlling the foot which is near the toes and that's perfect but regarding the heel sometimes the heel will get through the ground so it might not be a big deal whenever you're doing this kind of animation honestly we can we could skip this and just add a few efficiencies and we won't notice but my goal here is to show you that you can really find tweak everything about the foot contact to do so we need to create an empty this is going to be a target where the heel will be pointing out then i will add to it a simple copy transform from our controller foot the cool thing about the copy transform constraint is that we have the option to ever snap to the end of the bone or to the tail of the bone or wherever on its surface so i will make it slide until it's more or less onto the heel of my character from there i can bake the animation of the current empty on my whole animation so i will bake it on the 150 frame when i'm done with this i will make as we did for the floor constraint i will add to it a shrink wrap constraint with a project on the wall space z on the positive direction so that it won't get through the ground so basically it will be following the full motion of the heel of my character and whenever it is supposed to get through the ground the shrimp wrap modifier will avoid this issue so basically it will be stuck to the heel of my character so if i ask the heel to point to it it won't move unless we are modifying the position of the empty with the shrink wrap so i can add a dumped track constraint on my foot controller and aim at this empty as soon as the empty will go onto the surface while my foot was going through the ground the foot will rotate to point toward this empty and since we have already fixed the head position of our foot controller now we are fixing the full length of our bone position and that's just matching the ground perfectly so now if we would like to make it even better we could add a couple of more constraints using mt2 to constraint each side of the foot so that we will both control the rolling on the foot on its local y-axis but also on the side-to-side motion so i haven't done it here because it will be repeating the same stuff but i did use exactly the same method to fix the toe bone so i will just duplicate the empty remove any constraint add a copy transform from the toe bone onto this empty make it slide to the tip of the toe and bake its action then i will add the shrink wrap constraint so that it won't get through the floor and i will use it to add a dumped track constraint onto the toe you can also use a locked track constraint so that the toe will only rotate on its local x-axis so here you can see the power of the dumped truck constraint when it comes to cleaning baked data and we'll use it to make our character lean while is turning when you get to this point you can choose to use manual animation to make your character lean when turning on the ground so we simply have to add a new action into dnla set it to no extrapolation and blending to add now i will select the root of my torso i will switch to euler rotation because it's gonna be easier and i will set a keyframe on the frame 0 and now i will just play the animation and set a few keyframe depending on what's happening so whenever is turning left i will make him lean a bit forward but also slightly switch its weight on the left and make its whole torso leaning on the left so that he keeps balance while there is inertia so you can do it roughly and then work on your animation curve to make the animation as clean as possible this is absolutely viable and if i were in production i think i would do it this way there is an obvious benefit quality wise and it doesn't require that much work since this one can be a bit confusing even for me i've tried it several times before i get to the solution we will work with those simple arrows this main arrow will be our robot i've added a simple follow path and it's following the curve i will do the same with the second arrow i will add to it a follow path constraint and target my curve i will duplicate this little red arrow and the cool thing about the follow path constraint is that you can offset the position of the target object on the curve and this is what i'm going to do so now we can see all our arrows following the path but there is one that is offset or that is in front of the other i will enable the follow curve for all of them so that we can see them sliding onto the curve properly to make things as obvious as possible i will duplicate again one of the arrow and i will give it a new material that i will set to blue i will remove its follow path constraint and i will parent it to the first arrow but i won't use the set inverse option so by default it got snapped onto the red arrow so i will offset it to show it to you and you can see that it has no rotation value even when we are playing the animation since it's a child of the red arrow it will follow any of its transformation rotation included but in its local space it won't be rotated so now i can add a dumped track to it targeting the arrow that is offsetted on the curve and now when we play the animation we can see our blue arrow pointing at the offset arrow and since this rotation is due to a constraint it's outputting rotation information that we will be able to use to make our green arrow lean left or right this is super powerful because we are getting rotation information based on the curve variation so now i can add an empty and i can parent it to the red arrow that is aligned with our green arrow the green arrow is supposed to be our robot i will set without object inverse the empty is aligned with the red arrow i will offset it vertically so you can see that on its location only its z location is modified its x and y location are not modified so what if i now use this empty to constraint the green arrow with a dumped track constraint i will select the z-axis so that the top of the arrow is pointing to the empty now as soon as i move the empty the top of my arrow will point at it and if i move the empty on its local x-axis sit it to line with the curve my green arrow will be leaning but it will keep its orientation along the curve i will right-click its x-axis channel and add the driver and i will edit the driver and we will use the local zero rotation of the blue arrow to drive the offset of dmt on the x-axis it means that the empty will move left to right based on the rotation of the blue arrow which is based on the variation of the curve so our green arrow will lean left to right depending on the variation of the curve from there we can study the behavior of our green arrow its currently leaning whenever there is a variation in the curve to make it leaning inward or outward on the curve i just have to edit the driver multiplying the variable by a negative value will make it leaning inward positive value leaning outward the higher the value the more leaning there will be so this is exactly what i did on my character i've added the same mechanism and it's currently constraining the root of the torso i've created the environment using quick cell mega scan free assets i've lit the scene using an hdri from htri heaven and the puff of dust were made by using simple image sees dirt charge from video co-pilot onto simple planes i hope you've enjoyed this tutorial this one was of the most challenging i've ever made so give it a like if you like it and subscribe i see you in the next one [Music] you
Info
Channel: Pierrick Picaut
Views: 37,097
Rating: undefined out of 5
Keywords: blender3D, modeling, shading, rigging, B3D, p2design, sculpting, digital, animation, cartooning, rendering, CYCLES, tutorial, Pierrick, Picaut, Pieriko, 3D, Computer, Graphic, blender, eevee, VIDEO GAME
Id: MXHW8nAURms
Channel Id: undefined
Length: 20min 27sec (1227 seconds)
Published: Wed Oct 14 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.