Advanced Character Rigging Tutorial for UE4 with Blender, Rigify and Uefy 2

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

In this video I use uefy to add extra bones to rigify's metarig. Unlike the previous tutorial in this series, this time we keep it compatible with the Epic Skeleton.

👍︎︎ 2 👤︎︎ u/RakizFarooq 📅︎︎ Dec 15 2020 🗫︎ replies

Uefy is such a good plugin. I'm just so glad I found it. If anyone sees this you should seriously consider it!

👍︎︎ 1 👤︎︎ u/Brian2524 📅︎︎ Dec 16 2020 🗫︎ replies
Captions
welcome back everyone in this video we're going to take a character from the elemental demo and add an animation rig to it using blender rigify and uefi 2. this project is freely available from the unreal launcher it was one of the first tech demos used to introduce the engine so this is quite an old project and this character that you can see on the screen right now its armature is not really compatible with the unreal engine mannequin because it predates that by quite a few years we're going to use the add-on to give this character a brand new skeleton with full ik and fk chains we have a lot of accessories like shoulder pads and armor plates on the back and on the sides so we will take a look at how to add additional bones beyond the basic mannequin hierarchy to support these items even though we use this character as an example in this video it's really more about the process so you could take a character from just any source like a marketplace or maybe a character creator and as long as it meets a few basic requirements which we will get into later in this video uh you can use the add-on and you can use blender to just replace the skeleton and give it a rig so that it is compatible with both blender and with the engine this is going to be more of an advanced tutorial so if you haven't used the add-on before or if you're new to rigifi or just new to blender in general so maybe check out some of the other tutorials that i've made there'll be links in the description you should definitely start over there maybe just not start with this one if you haven't seen any of this before i've also made a few animation tutorials so be sure to check those out as well part of the reasons that we go through this process asides from all of the compatibility issues between blender and the engine is that this process gives us an animation rig in blender like this character is already moving about walking about but this is only a deformation chain where skeletons move the mesh parts directly but an animation rig may be composed of hundreds of phones where the purpose is to just give us controls that we can so we can easily create new animations that's something we can't do with just the deformation chain so be sure to check out those tutorials as well i'm just going to let this video play out to the end before we start the tutorial i'm going to select everything in the scene x to delete and then set the unit scale to 0.01 uh setting the unit scale cuts off part of our view so we press n to bring up this panel and then set the clipping distance to 50 meters so we have the full range of you again then we can do file import fbx and bring in our mesh so i'm going to select this uh mesh i'm going i will turn off animation and in armature i will set automatic bone orientation this value has to be determined on a mesh by mesh basis so it might not be appropriate for your character but it is for this one now we can just create another scene collection like so and then i'm just going to bring in the unreal engine mannequin just for reference so we will select the mannequin again we don't want any animation and we want automatic bone orientation now i could select one of these bones like that and then do gy1 to move it back by one grid line okay let's just examine what we have in the mannequins i'm gonna turn off the character and then select this go to the armature properties and put this in front and then we can go into pose mode and i'm just going to hide some of these larger bones like that so i'm just going to hide this like this like that and we want to examine what the spine in the unreal engine mannequin looks like so if you see here we've got four bones in the main body okay so one two three four starting with the pelvis and going all the way to spine underscore zero three and then we have two additional bones for one for the neck and one for the head so if you want to rig our own characters we need a similar kind of setup in in the imported mesh okay so let's hide the mannequin now and examine what the imported character looks like so again same thing select the armature go to the these properties here put this in front and go into post mode again we can just select one of these large ik bones and hide them and do remember that the add-on will build us the ik setup by itself so we don't really care what the original ik bones look like because they get built for us and the same is true for the twist bone so we don't really bother with creating or managing twist bones because the add-on will build them as well so i'm just going to hide these large ik bones so we have a better view of the character and now we need to do two things here we have to identify all of the bones that are in this character but not in the unreal engine mannequin for example take this this bone here this controls part of the armor that is attached to the side of this character and this bone is has uh control of the shoulder pads so these things are not in the unreal engine mannequins skeleton but we need to identify what all these bones are make a list so we can recreate them for our character that goes to the engine but that comes in later first we need to identify whether or not the body has the necessary forward bones in the spine and two bones for the neck and head so we can start with this one it's called pelvis and it corresponds with the pelvis and the endurance and mannequin so i'm just going to zoom in over here and go into wireframe mode and the next bone will be this is called spinae square zero one i it may be named something else in your particular character but it needs to be there but then we have spine underscores earth two and we also have a fourth spine underscore zero three here it's kind of hidden behind these two bones so uh it's kind of hard to see but it is there so we have the required four in the main body and they move the uh character we also have a neck right here and we also have a head and you can rotate these bones and just confirm that they are working correctly now what happens if your character doesn't have the required number of bones you might need to either select one of these bones and subdivide or pick a bone and then just delete it so the number has to match fourth for the main body one for the neck and one for the head six bones in total now that means that you might have to adjust the weight paint that's usually fairly simple if your character is already weight painted you just have to smooth over the weight paint between two bones uh but for this character we have the required numbers we are only interested in bones that exist in the unreal engine mannequin so that are not iks or twist phones so that kind of limits the set fairly uh down to quite a bit so for example you can see there are extra bones beyond the head we don't care we don't care about this bone we don't care about any of these but we need a clavicle because the mannequin has a clavicle and so we have a clavicle here it may not be called clavicle in your mesh maybe called something else but you need a corresponding bone for that uh similarly we need one for the upper arm one for the lower arm one for the hand so these are four bones for this name and there are also four bones in the leg we also need to make sure that the bones and the limbs are pointing correctly towards each other so for example this toe bone is pointing straight up so we can't have that so i'm just going to go into edit mode and again hide this large bone then i can select this part here and do shift s cursor to select it then i can select this bone r to rotate x to lock the axis and then nine zero while that kind of rotates around center so i'm just going to do 3d cursor here and then r x 9 0 and that'll fix that and then i can select this part and do shift test selection to cursor okay and then i can select this bone and this one and then do right click on this and symmetrize and that will fix the other side similarly uh this arm bone is not pointing towards the hand so what we can do is just hide this select this part do shift as cursor to select it and then i will move the lower arm bone into its correct place by doing selection to cursor okay so now i can select the lower arm bone and then shift select the upper arm bone and then do shift in active bone active bone is the last bone that is selected in a multiple selection so this is going to recalculate the roles based on the last tone that was selected so these are now more properly aligned for the last bit we need to make sure that the hand is aligned like it is in the mannequin so in the mannequin uh this bone is kind of centered between the middle and the index fingers and also we need to make sure that well let's just go into orthographic view and go to solid view you want to make sure that these hand bone is rolled in such a way that one of these flat surfaces is towards the palm and the other flat surface is toward the top so i'm just going to go into item and roll this bone manually it doesn't matter which side we pick right now just uh make it like so right so one flat side is towards the palm and the other flat side is toward the top of the hand and the uh the bone itself will be kind of between these two these two fingers and from the front it's also i think it's a little bit lower than that you can open up the mannequin for reference if you want to okay so that should be okay and then we can just select this one and then this one and then right click and symmetrize to fix the other side and that takes care of the edits that we need to make to this character just a quick recap when we started the first thing we did was to make sure that we had the required number of bones so six in the spine four in the limbs and the second thing that we have done is to make sure that the bones point towards each other in the limbs so we don't care about the spine or any of the other accessory bones here just these four bones in the limbs so now that that is done we can move on to the next stage i'm going to turn on names and scroll down to the uefi script panel okay so i'm going to click on refresh list i will make sure that this value is the name of the unreal engine mannequin that we imported and this value is the name of the armature for the character that we are working on okay so it'll be this character right here uh then further down we can go to character operators and look at this drop down it's going to be empty i'm going to do a scan to get these get a list of these names and it'll be in this custom value here and i will also click on this button here to get two extra values so i'm just going to select custom here and then go to scripting then i can open this drop down and select the uefi mapping custom that is the custom from the drop-down list and then just take this to the top and then i will drag on this corner to get another window and for this drop down i can select the ue5 mapping mannequin and again take this to the top our purpose is to uh rename these bones so that they have the same name as as their corresponding bone in the unreal engine mannequin for example uh this bone is called be our underscore mf underscore pelvis but in the mannequin is simply called pelvis and the next bone should be simply called spine underscore 02 like it is in the mannequin so uh we could just go step by step do f2 and manually rename all these bones but we have tools in the add-on that can help us with this one of these tools is in the scripting panel custom file the first column has names of all of the bones that are in the armature and the second column is what we would like those names to be so for example for this pelvis i can simply copy paste this to be the same name as it is in the unreal engine mannequin and the script will just uh rename all of them in one go for us now if this was a if this was not a unique character if this file was to be reused i would just fill this out the whole thing in one go but since because i know that this is a unique character and i won't reuse this file uh there are some additional tools that i will use to help cut down on the work that i have to do so i'm going to scroll further down here to the bone rename tool uh it's it'll be over here bone rename tool and then i will use this tool to rename some of these bones now it's not always going to work because a most of the characters that you'll find in the real world for marketplaces and whatever they'll have a lot of bones additional bones attached to them that are not in the mannequin for example the spine has a lot of armor bones and other things attached to it so this tool cannot determine what path to follow unless there is only one path for example i can select this leg and then i can do left leg here left leg and then rename bones and you'll see it's called thai calf foot ball exactly like we want want it to be and similarly i can select the base bone for the chain and then i can just do right leg uh like that and then rename bones and all of these bones get renamed for me in one go but it's not going to work on the spine for example if i pick the pelvis and then i i select spine here like so i'm not going to run this but it'll mess up because there are a lot of additional bones involved here and it doesn't know what path to follow i won't work on the arms in this character either but i can rename the fingers and that still saves me a lot of copy pasting so this is going to be the left index rename see it gets fixed uh this is the middle my more so wow i'm going to scroll back up here to the character operators and run scan one more time now that that's done uh we can go back to scripting and if you look at this file here that we had opened previously so let me just scroll down here this is the uefi custom mapping you'll see that some of the names in this first column have changed okay and now they match what they would be in the unreal engine mannequin so any name that is already correct is something that i don't have to fix so all of the fingers are fixed so i don't have to do any of this copy pasting and the only thing that is left for me to do is fix the spine and the four bones in each of the in each of the arms because while the the the bone renamed to fix the legs as well now i can start at the top of this column and then just go down one by one and i'm only interested in bones that exist in the unreal engine mannequin so the first thing that we come across is the pelvis so i'm just going to copy this and put this over there and then this doesn't matter these are all correct okay so we get to the spine so spine one should be called this and similarly we just update them one by one okay so up next is next so where is the neck bone let me just click on this and go to neck and the neck is called this okay so do do keep in mind that you have to be exact with this it cannot be any permutation of what of what the actual name is so if it's called neck underscore 0 1 it has to be exactly this that's what one reason why we're just copy pasting and not typing this in manually so i went ahead and fixed the remaining bones so if i just go down here you can see i renamed the head and the bones in the arms like the clavicle the upper arm and the lower arm the hand and the rest of this just uh all right anyway now if you get confused about which bones you need to update remember you can always bring in the mannequin and then you can just click on each of these bones and see what they are called and what where they are located and what the corresponding bone name should be i'm going to put away the mannequin like so and now that the scripting file has been updated we can simply select this armature and then do apply and that should fix all of our of all of our names now again we are only interested in the names that exist in the mannequin and are not ik or twist bounds so i'm going to scroll up here turn off names and then turn on axes these bones have an orientation they are rotated in a specific way and you can open up the mannequin and see how the bones are oriented in in that just for reference as you see this line the x-axis the red line this needs to point towards the back of the mesh this for this phone the same as it is in the mannequin so you can reference the mannequin for this and we need to rotate these bones so they are oriented correctly but there is an easier way to do this then rather than do it manually i will just click on auto rolls here or magic rolls and this is going to try and guess what the orientation should be i guess it mostly right it's more accurate for t post characters but we can fix whatever it misses out now to check this we can simply zoom in on one of these bones for let's start with the pelvis uh you can see x points towards the back so this is correct and x points to the back on this one this is correct this is correct and let me just grab this and you can see the x is pointing towards the back so just undo that and this is correct as well uh the neck is correct but the head bone is a little tricky on this one so let's go to the side because the way it's orientation it was oriented it was not rotated correctly so i'm just going to grab this bit here uh set it like so and then we can go down here uh select this bone and then do set this to minus x and then roll the bone okay so now x is pointing towards the back and these are the six spawns that we are concerned with and we can ignore the rest now we can do the same for the limbs so i'm just going to zoom out here go down here x points towards the back so the these two bones are correct and we'll get to the feet later on and then further up here the clavicle must have x towards the back the upper arm the lower arm uh let's just grab this and you can see he access towards the back and we'll get to the hands in a minute now for the feet uh the foot bone will have x-axis and the same direction as this line over here and the and the toe will have x-axis pointing straight up for the hand uh let's just zoom in over there it'll be pointing straight out from the bottom of the hand uh the same is true for the fingers you can see okay we may have some problems here okay this finger is correct every bone has x-axis exiting from the bottom of the finger but there seems to be an issue over here this phone did not roll correctly so i'm just going to roll this to minus x so again x axis out from the bottom this phone needs to be updated as well uh and this is going to be on minus the right so this is correct and this is also needs to be updated also needs to be updated and also needs to be updated again uh this auto rolls things works much better on t post characters rather than something like this but that's okay we have fixed all of these fingers and remember for the thumb at the bottom of the thumb is quite often towards the side and not exactly pointing towards the floor so you can see the x-axis is out from the bottom of the thumb which is actually towards the side so these bones are all correct so whenever you make changes like that let me just deselect everything box select everything like so right click and then symmetrize to fix the other side so you have to do that again we didn't need to do that with the head because there's just a single bone in the center but whenever you roll a bone like this be sure to symmetrize and fix the other side and do keep in mind that we consider only the left side so just these two bones those four bones in the spine so we don't really care what's going on that side and the uh orientations will quite often be flipped so just fix them on this side use symmetrize to fix the other side and it will automatically be correct with that out of the way we can go back up here turn off the axes and i'm going to bring back the mannequin and go into object mode and select the armature for our main character now for this next part we need to make sure that the armature has location of zero zero zero rotation of zero zero zero and scale of one one one and the same must be true for the mesh itself so click on the mesh check these values click on the armature check them again you can do ctrl a and apply all transforms to get rid of any rotations or scaling issues once that is done we can go scroll down here and uh i'm going to click on pose character and that'll match the pose of our character to be the same as the mannequin and then we don't need the mannequin anymore now we can adjust the feed a little bit more so i'm just going to go to the front view uh scroll down here set this to individual origins then i can rotate this into place like that and then go to the side view and then rotate it into place like like that then i could do ctrl c to copy it shift ctrl v to fix the other side i'm just going to check from the front once more and i could do a to select all g to grab c to lock axis and bring everything down a little bit and i'm just going to check from the side maybe it's a bit too far down so about there should be okay right now we're just interested in what the mesh looks like so if the if the bones of the foot get kind of uh oriented so they're no longer straight it doesn't matter right now we want the mesh to be as close as it is to the unreal engine mannequin's default pose as we can then we can fix the armature later if i scroll back out here uh ctrl alt to deselect everything and then if i go into edit mode you'll see that the rest pose is still what the original was but we want this to be like this in our updated pose all the time so we can go into object mode i'm going to select the mesh okay not the armature the mesh then scroll down here and there's a button called uh update rest pose so just click on this and now if we go back to object mode select the armature go into post mode and then go into edit mode and you'll see there is no change so the rest pose has been updated we can still make one more edit that will improve the final result so i'm just going to go to the front view like that and then scroll down here when we move the feet uh the alignment of the bones was no longer straight so i'm just going to go into edit mode i will select this part here and then i will simply move it into place like that and then i could adjust the roll straighten it out a little and then adjust the roll for the foot bone as well straighten it out a little again and then with this one selected and that one i could right click on it stem it tries to fix the other side and then i'll take deselect everything now we can do shift s to set the cursor to world origin so the cursor goes over there and then in object mode i'm just going to create a new scene collection uh select this one and then i can do shift a armature human meta rig and it'll be really small because of the unit scale so i'll just do s to scale type in 100 to make it a little larger which is not enough because this is a very large character so i just type s again and then use the mouse to uh scale it so the shoulders are a rough match okay this doesn't need to be exact but just got a rough match on the shoulders let's put this thing in front as well now we want to make sure that the scale for the meta rig is 1 1 1 so just to control a and apply all transform so that fixes the location and rotation and scale for us now we can scroll down here and we can set the well we have to click on refresh list and then we can set the meta rig to be this value and then we can click on fix meta rig and then pose meta rig and that'll position the metal rig onto our character like that and now we can fix the spine so i'm going to deselect everything like that and then i can select the armature for the character and then control click on the meta rig so i have these two objects selected at the same time and then i can go into edit mode with both of them selected and then i could box select this half like that and then just hide it and then do the same on the other side from the side view we can select any of the bones in the metal rig like that and then press l to select them okay so this is going to select the lower four bones and now i can move them around with the g key so i'm going to match the bottom of the pelvis with the pelvis in the original armature like that okay uh and then let's just go into wireframe mode so we can see what's going on and then i can select these three bones like like so and then i can match the next joint with like that and then i can select these two bones and then match the next joint like like that and then this one i could match the next joint like that and then i can also bring this down here okay so now generally we haven't done this before but we're going to put a break in the spine you can only put a break at the neck otherwise trigger five will generate errors so we can do the same thing for the neck i'm going to select this bone here press l to select the other two and then i can match the base of the neck like so and then i can move this joint down here to about over there and that should work out well for us so i'm just gonna bring this down lock it on the z-axis and uh over there seems fine okay so now let's just hide this for a minute and look at well not the whole thing just the bones i guess so just look at what this metaric spine will look like you may want to adjust it a little bit may want to update wheat painting if if you think that is necessary or it's going to help but generally a spine like this is going to work okay i'm going to bring back uh the hidden bones and go back to solid mode and then from the front uh we're still editing the meta rig okay so the character's armature is still hidden and we just need to update this heel bone so i'm just going to grab this lock it on the x-axis and then just slide it over there and then click on this part g x to lock on the axis and then bring it over there and then select the whole bone go to the side view grab it again lock it on the y axis move it back to about over there and then i could right click on this and semi tries to fix the other side and that's just about everything that we need to do for the meta rig okay so i'm just going to hide the metal rig for just a second and bring back the character's original armature let's unhide all of that as well so we are basically done with this so i'm just going to go to object mode select the mesh and then i'm going to scroll down here and click on extract mesh this is going to separate the mesh from the armature and if your character is made of multiple parts multiple meshes they will all be separate so you don't have to do this separately now i can just drag this mesh object right into the collection with the meta rig and then we don't need this anymore okay so if we bring back the meta rig everything is basically in place but right now if we click on generate bricks it's going to create an error from rigify because of this break that we put in the spine to fix that we can go into pose mode select the neck bone go into the bone properties and then i'm just going to deselect connect chain and that's all we have to do so back into object mode and then in the armature properties we find the rigify buttons over there and then just click on generate rig to get our final rigifi rig into place so i'm just going to select the rig and then put it in front now i can click on the mesh shift click on the rig then do control p armature deform this is going to attach the mesh to the rig and then i can select just the rig by itself and then scroll down here to generated rig operators and i'm going to make sure that the mode is set to epic skeleton and then i can just click on build skeleton and give this a minute i'm going to hide the meta rig and at this point the character is basically rigged and working uh for the primary chain of bones that exist in the unreal engine mannequin for the shoulder pads and the armor plates we need to add additional bones to the metal rig but that's relatively easy now that we have the main character working i'm going to bring back the meta ring go into object mode select the meta rig go to the front view and then i can go into edit mode and then from over here i'm going to find basic super copy this is going to get used a lot it has it's it's a very versatile metal example i'm just going to add sample because of the unit scale it'll come in skull small so i'll do s to scale type in 100 to make it a bit larger so we can see then use the g key to move it into position like so and then improve the position like that go to the side view and move it about over there right about over there again from the front view i'm going to grab this part g key again and then place it like so and then move it into position like that now i'm going to press f2 and i'm going to call this armor flap left now i can go to the bone properties open up relations and set the parent to be the spine so i'm just going to select the spine from this list the spine is this bone and what this does is it sets this as the parent for the armor flap and you can see that there's this dotted line between them now we also need to set the layer for this bone for instance this spine bone is on this layer this leg bone is on that layer so i'm just going to put the armor flap on the seam layer as the leg bone is because they're nearby when we select the left leg controls in rigify's user interface to make them visible at the same time the armor control for the left flap will also show up with those same bones because of this layering system if we bring back the original armature for this character you'll see that this bone is kind of pointed out that way this is how it was imported into blender but we made our new bone uh in a way that makes more sense relative to our mesh but and we can get away with this because this is not a primary chain bone it's not in the unreal engine mannequin so we can actually change what it looks like but uh right now as you can see it's not exactly at the same place as the original so just i'm just going to improve that a little so i'm going to select the original armature edit mode select this part here shift s cursor to select it go back to object mode select the meta rig edit mode and we're just going to move this bone to where the cursor is and what this will allow me to do is that when i export this uh character to unreal engine if there are animations that that were authored for the original armature that will retarget a lot better if the pivot point is at the exact same position even if the bone is pointing somewhere else and we can get away with this because it's a it's a single bone there is no there aren't any attachments to it there aren't any children that depend on its on the location of its end point so we can get away with this but for other bones that are in the form of chains you might have to actually put them exactly where they are in in your new meta rig as they are in the original armature if you look up here at the shoulder for this character you'll see that this bone here controls the shoulder pad so let's just go to object mode i'm going to select this go to edit mode select this part here shift s cursor to select it and put in the cursor here is just going to help us place this bone in our meta rig a little bit better a little easier and then go back to object mode select the meta ring again make sure it is demetering from over there and then what we can do is go into edit mode and then in the armature section we can add one of these metal rig samples a lot of them are deprecated and the only ones supported by uefi are listed in the facts section on the on the product page there will be a link in the description and on screen so you can check which ones are supported uh most most commonly used one is going to be super copy so i'm just going to add the sample one more time scale it up by 100 again because of the unit scale and then i will do shift as uh selection to cursor it'll move over there and then from the front view i can again just grab this part here and then move it like that and then from the side i will move it like like so i'm just going to turn off the original armature so we can look at the metal rig and these this new bone that we've just added so i'm going to select this press f2 let's call this shoulder armor left now i can go into bone data properties and set its parent to be the shoulder bone on the left side for the layers uh let's put this on the same layer as the main torso bone so it is this layer over there so i'm just going to select this and put it on the same layer now if we look at the original armature i'm just going to hide the metal rig here uh this shoulder pad is actually controlled by three bones so there is the mean bone that will move the entire pad but there are also two additional bones that compress and stretch the upper and bottom parts of this shoulder pad so i'm just going to select one of those bones let's go into object mode select disarmature go to edit mode let's go into wireframe mode and i think it's this one nope yeah it's this phone here it controls the top part of the shoulder pad so i'm just going to do shift s cursor to selected or rather i'm just going to select this just this part here then do shift s cursor to select it like that and then we can go back to object mode into solid mode and then back into the meta rig and we let's turn this off for the minute so now let's add those two additional bones so we can uh select the meta rig go into edit mode and then same as before we will go into the armature section add in another basic super copy sample s to scale type in 100 to make it larger and then shift s selection to cursor so it moves it right where we want it to be then i can grab this part here drag it up like like so so okay i'm kind of just following the the curvature of this shoulder pad like that then i will select this entire bone do shift d that'll make me a duplicate then i can again select this just this part here now i can move this to the bottom part over there so it is to just just control the uh the lower part of this shoulder pad crease or something something like that now let's edit these bones so i'm going to call this shoulder [Music] armor top on the left side and shoulder armor bottom on the left side right and same as before we need to parent these samples to something that is already in the meta rig ah that's just a rule we have to follow with uefi add-on so we go down to the bone properties and we can just set this to be the shoulder shoulder pad uh bone itself so this this bone that we added previously for both of these things the parent is going to be the shoulder pad itself like that and then again uh this thing is on that that layer so i'm going to put everything on that layer so it shares a layer with the torso now now i'm going to select this part here that is the base of the head and then do shift s cursor to select it and then i can add another sample same thing basic super copy like i said this gets used to loss scale it up by 100 shift s selection to cursor right it gets uh it will overlap with the previous bone and then i'm going to call this bone to be face and in the data properties i'm going to attach it to the head or well the head is going to be called spine underscores 0 0 6 like that and then uh it should be on the same layer as the rest of these bones are like that now this facial rig that we're constructed constructing is not the same thing as the face rig that comes with rigidify you can add that if you want but that's really complicated thing to set up and right now we're just going to follow this very simple facial setup that that exists in the original armature for this character so if we go back to object mode go back to solids and let's just look at the original here for a minute you can see there are two bones you can find here uh if i edit these this one is called face and then this one is called jaw now i don't think this was supposed to be pointing in this direction it's just how it got imported into blender so in rather than placing it here i'm going to place the face bone what it would be more like in a in another rigified project so i put the face pawn in and i just need to add a jawbone like that and then we will be done so i'm just going to select this part here do shift s uh cursor to select it and then we can go back to object mode we can select the meta rig and then turn off the original armature again so now same thing back to the armature section go into edit mode and then we can add another sample so it'll always come in down there somewhere so scale it up by 100 shift s selection to cursor i goes over there let's take it look at it from the side and then i can just grab this part and put it in like that and that that's our jaw right so we can put this to be the jaw and then in the bone properties this is going to be connected to the face like so and everything we're putting everything in the in the torso torso layers so that goes there you can select you can change this later on this is a really simple thing to change so it's not a problem if you don't like the current placement we can always update this later now if we look at the original armature again and i'm just going to turn that on turn off the metal rig uh object mode select the armature and then let's go into wireframe mode or let's go into edit mode it's a bit easier to see you can see there's bone here right this one this controls the entirety of the backside armor plate on this character so we need something similar in this position in our meta rig so i'm just going to do shift s cursor to select it and then get out of here with solid mode object mode turn this off and turn on the metal rig again so uh again same thing going to well you have to select the meta rig then go into edit and then armature section again another super copy add the sample scale it up by 100 shift s selection to cursor it goes over there uh i'm going to call this the back armor then we can go to the bone properties and i've set this parent to be spine underscore spine.003 okay again put this on the same layer as the rest of the torso and now we just have one more addition left to make so back to the armature section and then add another super copy scale it up like so then we can go to the side view like that and then use the use the g key to move it up till about there and this one should go roughly like this so i'm just going to grab this part and put it like that and then we're going to call this the front flap and we're going to parent this to the spine the the bottom one and again set the layer to be the same as the torso so that is pretty much for all of the unique bones that we add to this character um some of these bones we're going to duplicate onto the right side for example the shoulder pad and the this flap over there but if you look at the original armature so let's just go into object mode go to solid and then uh let's hide the metal rig and look at the original armature here you'll see that there are a lot of bones that we just did not account for so many of these are iks okay so we can completely ignore the ik bones and all of the twist bones in the limbs if there are any this character doesn't have any but if there were we could ignore those two because the add-on will build them for us uh there are a lot of additional bones that don't deform the mesh but are there to support animation and support the animation process inside the engine for example like camera attachment points or attachment points for other objects so we're going to ignore those two so right now we're just interested in the in the bones that actually deform the mesh so that pretty much covers everything that we need from this so we can just turn this off and going back to the meta rig we can finish duplicating and finalizing this thing now so edit mode select this bone right there and then right click on this and semi try so that'll add it on the other side but for this one we have we do have to be careful about one thing uh on this side if you check the layers it's on the same layer as this leg is over here right so you can you can check the layer over there but if you check the layer on this leg it's on this layer but our symmetrized bone will still have the other layer from the other side so we don't want that to happen uh in this case we just want to select this layer on this bone as well so just going to update that so that's just something to watch out for for for these three bones we could just do right click and cemeterize because everything is on the torso they will they're both fine on the torso layer and again you can always change this not a problem the rest of the bones are unique and it really doesn't matter this is not going to affect those phone it is important to know that you can only add samples to the meta rig for example this phone if you go into pose mode in the bone properties you can scroll down here and in the rigify type it will tell you that this bone is of type basic super copy and if you click one of these fingers it will tell you that it is a limb super finger or if you click on on the base of one of these samples it'll tell you what kind of sample is it it is for example if i click on this on the base of this finger it tells me it's a super finger but if i click on the next bone there's nothing here okay so sometimes you get you can use samples like these which is just a single bone and sometimes you use samples like these which are multiple bones but in no case can you just attach a standalone bone directly to the metal rig that is not that is not a rigified sample type so if you attach something to the metal rig it always has to be from uh this list now let's go into edit mode from this list over here in the rigidify buttons and again from within this list only those samples that are listed in the ue5 product page that are compatible and are supported but you'll find that the ones that are supported will cover just about anything now we can go to object mode and then in the armature properties we could go to generate rig but before we click on that make sure that the rig that was previously generated is visible and not hidden otherwise there will be a problem and then we can just simply click on generate rig and it'll update our rig for us and then we can scroll down here and click on build skeleton another time and give this a minute now let's turn off the meta rig and take a look at this character i'm just going to scroll up here and shift-click on this layer to show the bones that were added by the uefi add-on now we can see that because of our additions to the meta rig we have additional controls like this for the shoulder pads and these bones here and these controls over there for the armor flaps on the side and of course everything else that was also added but if we try to move this character you'll see that it is not deforming anything other than what it originally was just yet to get the original weight painting to work for this character the names of the vertex scripts i need to match the names of our new bones and we have two tools in uefi to help us do this so if i just scroll down here i'm just going to update this just because we can right now so i'm just going to make sure that this is at armature pointing towards armature correctly and then i'm just going to scroll down here to the skinning rename tool and the select vertex scripts tool the first tool can be used to reduce a scan and then in scripting let me just drag this corner like so to get rid of this and in this drop down we can now select uefi skin custom now what this does is it lets you rename the bones in the export chain that is the bone hierarchy that will go to the unreal engine or any other software that you choose and you can rename these bones to be whatever you want them to be so it works the same way first column is what the names currently are second column is what you would like them to be if you choose to rename them we won't in this video because it's not it's this is kind of optional not necessary do be careful that if you do rename a bone you have to make sure that it's not going to have a collision with something else for example uh in this bone if i wanted to just get rid of this prefix that'll leave me with shoulder underscore armor underscore l which is unfortunately the name of this control as well so if you don't want to have this kind of collision when you add phones to the metal rig you need to add your own prefix to them so at this stage you will you can then rename them by simply removing the prefix and you won't have a collision with any of the controls so something to keep in mind but this is kind of an optional step so we're not going to do it right now the main thing that we need to get this character to deform correctly is to update the names of the vertex scripts so they match this uh this bone hierarchy the vertex scripts are stored in the mesh they are not in the uh in the armature but to to get to access them we can simply select the armature here and then from over here we could do scan vertex scripts now this is kind of useful because your armature may have multiple meshes attached so this is going to cover all of them so once you do the scan here again you get a custom file layer so from this drop down we can select uefi vertex scripts custom and this is where you can see all of the vertex scripts now if you look down this list you'll notice this bone right here or this vertex scripts it's called b underscore maf underscore jaw so where did this name come from so well if you look back in the layout i'm just going to turn off the armature and bring back the original armature this was the one that was imported from the fbx file uh the one that we that this character originally had and then if we go into post mode and select this bone you can see it is called b underscore mf underscore jaw so the vertex group is just really the name of the bone and the original armature similarly if i select this bone this controls the the shoulder pad and this is what it was called in the original armature so b underscore mf underscore armor uh shoulder offset on the left side so going back to scripting we just need to replace these names to be what they are in our export chain so this jaw is now going to be called you underscore jaw and similarly we just need to update the rest of these names to to help us do this we can also again just drag this over here and in this part i can open up uefi skin custom this is the file that we just scanned previously and this is the name of all of the bones that will be in the exported file so we can use this as a reference so as you can see we have a jaw and it's called this exactly so we just copy this over there and similarly uh other things that we need to update are this shoulder shoulder bone so we just find it what it's called over here uh this will be u shoulder armor on the left side so i'm just gonna copy this and i'm going to put this over there so just remove this and i'm going to put this over there like so and that's all there is to it you just have to update these names and that is it so copy this and then put this over there now this is for the top so this will be this will go over there in the bottom portion will be over here right so this is the bottom on the left side and top and left side similarly we will uh also update for the right side i'm just going to find the bones for the right shoulder armor i'll copy this so one do and that is all the bones that we need to update back in layout we want to make sure to select the armature and have it in object mode then we could simply go down here select the name of the file custom and apply the vertex groups and now if you move this character it should deform perfectly and all of these controls should also be working so you could move the the shoulder pad or you can rotate parts of it this controls the bottom part and this one will control the top part similarly the flaps will also be working and it this is this character is basically now ready for animation but there is one piece that is still missing so if i if i do this you'll see that there is something strange going on with the boots that's because we did not add these two vertex scripts to our character now the preferred way to deal with this would just be to open up the metal rig again like like that and uh simply add two additional bones to for for boots and that is perfectly fine you could we could have built this entire character incrementally we could have added the flaps and then did the whole generate break and build skeleton and then added the shoulder pads and then rebuilt it and then again and again so you could build this incrementally uh we just did it in one one single pass but the problem here is that if if you add a bone over here to the foot uh you can see that this heel bone is kind of attached to this foot so rigify tends to get confused when you add attachments to this area of the rig so we just tend to avoid it for this particular sample for the limb or leg samples but that's something we just have to accommodate rigify for here so another way we can deal with this is to just add add it directly to the export chain if you need it or another way yet again is to just add the vertex script directly to an already existing bones because this is such as such a small piece so that's what i'm choosing to do at this point i will go into object mode and select the mesh remember the vertices grips are all in the mesh and not in the armature so we select the mesh and then here we could go to vertex scrubs drag this open there is the boot left and both right so i'm going to go into edit mode while on the mesh alt a to deselect everything uh let's go into wireframe mode now i can select this so this is the this is the portion uh that we need to attach to something else so i will remove it from this vertex group and then i'll find the calf so that would be the calf on the left side and then i'll simply assign all of these vertices over there and then i'll do alt a to deselect everything uh same for the other side select the vertices grip uh select select the vertices remove these vertices from this group and then we'll just find the calf on the right side over there and then assign them over here and then deselect everything go back to object mode solid select the armature go to post mode and now we try this and you see our problem is basically fixed now we can turn off the transform turn this off turn this off so rig layers to the top rig main properties right underneath and open these two and i'm just going to keep root open here and then i'm going to deselect this so now we have just the controls and we can animate our character make our animations and when we are ready to export we go to object mode select the mesh shift click on the armature do file export fbx and i'm going to select the file that i will export this as or you could just type it in over there and then we want only the selected objects so this will exclude the cameras and lights and anything else that's in the scene uh we want only the deformed bones we don't want to add any leaf bones and we're not dealing with animation right now so i'm just going to export this and this exported will be for a blender based skeleton joint roll so we already talked about this in other videos so you could review those if you want similarly if you want to export this with unreal engine mannequin's original joint rolls for import using the mannequin's original skeleton we could do one additional step i'm going to select the armature uh scroll down here right to the bottom around over here in the export panel now you want to make absolutely certain that you make a backup of your blend file because this process is not compatible with blender or with rigify so once we do this this blend file is only good for exporting this character you can't do anything else with it you can't animate with it or anything but it does make an export that works with uh unreal engine's original skeleton for importing so i'm just going to click here once and then again same thing select the mesh shift click on the armature file export fbx and this time i'm going to select a file name where i will kind of indicate that this is with the unreal engine uh you mannequin joint roles so i'm just going to add a postfix to it again same thing selected objects and uh we want only the default bones no leaf bones and this this file can't really even make animations anyway so just export it like like so and now i could select this and run undo a couple of times just to just make sure that this this becomes undone uh but it's just better if you have a separate file for just just for this export you can also always generate the rake and build a skeleton again that deletes everything and resets everything so that's another path if you if you break something or lose a backup then you can rebuild it now to import our character into unreal i'm just going to click on import uh select the file with the blender based joint roles and then just click on open now i'm going to leave all of these values to their default settings and for the skeleton i will either leave it at none so that it creates a brand new skeleton just for this character or more likely i will select the skeleton for the unreal engine mannequin that i rigged in blender okay not the original the one that are rigged in blender and you can check the tutorial i did on how to do that and at the at the end of it or rather in it i explain in detail why i do that and how i use it to share animations but right now i'm just going to leave it at none and then click on import and that is it now if we click on the character we can go to the skeleton tab and make sure that the hierarchy actually matches the unreal engine mannequin which it does except that this character will now have additional bones for example on the head we have a u face and a u jawline just like we added in the meta rig and into our final rig and similarly we have a shoulder pad controllers its top and bottom controller and the flaps on the left and right side and also the back armor and everything else that we added to the meta rig from this mesh panel we can set our materials but before we do that let's just go back to skeleton and one very important thing you have to do is go to options and show retargeting options when we select none for the skeleton or in other words when unreal engine creates a new skeleton for your character these translation retargeting options on skeleton will all be set to animation which does not work very well so we want to set all of them to skeleton and then set the root to be animation and the pelvis to be animation scaled and similarly we want the i case to be also set to animation like so and this is just going to help in retargeting existing animations onto this character and you also want to click on apply to asset otherwise the skeleton will not show up in the retargeting list uh just one last thing that i missed is you go back to skeleton you want to open the retargeting manager and then bring this in and set the rig to be the humanoid rig and you'll see that the these values are already correct because our bone hierarchy matches the unreal engine mannequin so you we don't have to do anything and our pose is also correct because of the way the add-on posts the skeleton if you want to import this character using the unreal engine mannequin's original skeleton we can create a new folder open this go to import and i'm going to select the file with the unreal engine mannequins joint roles and then open this and from here i can select the original mannequin skeleton that comes with every engine template and then it is always in game mannequin character mesh so in case you have multiple skeletons you'll know how to identify the correct one and then i can just do import and you'll notice that this time it's not going to create a skeleton file because it is using the original mannequin skeleton you might want to do this if you're using third-party blueprints that were designed for the mannequin skeleton for with the original skeleton but generally in my process i usually use i usually rig a mannequin in blender and then use that as my base and if you look at the video where i rigged the mannequin i have a detailed explanation of why i do that and how i use that to share animations but if you're using third-party blueprint code that if you if those blueprints already exist and you want to use them with your character then you're going to want this this other character with the with the original joint rolls for the skeleton but generally i just use my own
Info
Channel: Rakiz Farooq
Views: 4,995
Rating: undefined out of 5
Keywords: Uefy, Uefy Script, Uefy 2.0, Uefy 2, UE4, Unreal Engine 4, Blender, Blender 2.90, Rigify
Id: v8UfX62SlI0
Channel Id: undefined
Length: 68min 59sec (4139 seconds)
Published: Sat Dec 05 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.