Blender to Unreal Engine 4 - Custom Character Workflow

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi everyone so this is a tutorial exploring or explaining how to get a custom character into Unreal Engine using the Unreal Engine 4 manikin skeleton okay so this is for blender and Unreal Engine for users and in this tutorial I'm going to be using blender 2.79 now I hope that doesn't disappoint some people because I know some of you guys out there are using blender 2.8 but hopefully the principles and the techniques shown here in this tutorial are fundamentally exactly the same in blender 2.8 okay so just by understanding the workflow even in 2.79 you can still apply that workflow in 2.8 it's just the user interface is slightly different okay okay cool so I'm going to go through the entire workflow from Unreal Engine getting the mannequin from Unreal Engine taking that mannequin into blender adding a custom character to it and then taking that custom character out of blender and back into Unreal Engine and going into Unreal Engine so it works with the mannequin works with the mannequin and the skeleton or sari works with the skeleton and all of the animations okay cool let's get started so the first thing I'm going to do is I'm just going to make a new Unreal Engine project okay and I'm using Unreal Engine 4 20.3 but you can use any version of Unreal Engine as long as this off the four point Unreal Engine 4 point 8 because Unreal Engine 4 point 8 was when the Unreal Engine 4 mannequin was introduced ok so I'm just going to make a new project I'm going to use a blueprint third-person template and I'm just going to call this project Yui are you for skeleton tutorial ok to load excuse me cool all right so here's Unreal Engine and the first thing we're gonna do is we're just going to take the unrelated format akin and export him from Unreal Engine so there's the mannequin skeletal mesh I'm just going to right click on it and go to actions export and I'm gonna put it in a memorable folder blended tutorial custom character now I've already got one there okay so I've already exported it but I'm just gonna overwrite that one that's exactly the same okay so I'm gonna overwrite it that's fine now you can uncheck collision you don't need the collision you don't need a level of detail and you don't need the vertex color so that just make it life a bit simpler the export compatibility should be default and click export there we go okay cool so this making a proper new copy of blender and so we're going to import the mannequin and the skeleton into blender and take a look at it for FBX and there's our FBX import all right so there we go we've got the Unreal Engine 4 mannequin in blender now I want to talk a little bit about what this what this specifically is okay so this is a skeletal mesh right and what a skeletal mesh is it's a mesh that's a mesh with a skeleton that's all a skeletal skeletal meshes that's the fundamental principle of a skeletal mesh okay the skeletal mesh is a term used in Unreal Engine 4 however in blender there's another component here which some people may not notice at first look and it's because it's kind of difficult to notice and what it is is that right down here in the scene root there is this empty okay now I don't know why that empty is there it's to do with the way that the Unreal Engine 4 exports the mannequin but the thing is is that we don't want this empty okay this empty can cause problems with exporting your character okay and the reason is one of reasons why is because this empty is the is the parent right of the of the sketch of the mesh and the skeleton right so this mesh and the skeleton is parented to this empty okay yeah and we just don't want it it just causes problems so first thing I'm going to do is I'm just going to delete that empty okay and it really don't need it for anything so don't worry that it's linked but however when when I delete it something's gonna happen right and I'm just gonna what's gonna happen is that the guys the mat animation my skeletons gonna get a hundred times bigger and I'm just gonna explain why that is right if you look over here in the properties panel and I've got the empty selected right you can see that it has a non you or it has a uniform scale but it's scaled down it's got a point zero 1 scale which means it's a hundred times smaller than it actually is right now because the mesh and the skeleton are parented right I they they are children of this empty right they Herot the scale of the empty right so when I delete the empty they're gonna be no longer constrained boy and they're gonna get really big okay so let's do that let's just delete the empty and as you can see they've got really big now we don't want them to be this big so I'm just gonna scale on down so I'm gonna I've got I'm using the 3d cursor as the pivot and it's in the center of the world I'm just gonna oops scale it down by point zero one and I'm just gonna do and go to edit mode and do the same thing with a skeleton okay so that's the first fix that we've got there right so we've got a skeleton so all we've got in the scene now right is the mesh and a skeleton and that's all we want okay now we want to add a custom carrot custom character to that skeleton so we don't want this guy we could we could for example now export just this guy just the mannequin and put take him back into unrelated for let's just let's just try that and see if it works okay so I'm just gonna go through export FBX now the FBX export options are really important okay it's useful to always use selected objects I just that's a really good thing it means it's only gonna export the objects you have selected and I've got them both selected that's that's great but when you're exporting a skeletal mesh you really really need to pay attention to this saying add leaf bones okay this setting is completely useless and you want to uncheck it so add leaf bones should always be unchecked on the animation tab if you're not exporting any animations you should uncheck baked animations okay because this is going to make things simpler if you are exporting animations you don't want to uncheck that obviously but you'll still want to uncheck add leaf bones all right but in this case I'm gonna uncheck both of those and check selected objects all right so I'm just going to put this into you and I'm just gonna call this ue4 mannequin blender exported right now we can go back into unreal engine just going to make a new folder blender exported import that guy back in so obviously this is not the goal to just export the mannequin into blender and an export now again but I'm just showing that hopefully this works right it should work so if you did want to do that you can okay we get the import options now first thing I mean you don't have to uncheck import textures do not create materials I'm just gonna do that it doesn't really matter okay and I'm gonna choose the ue4 mannequins govern and import right and that's worked fine great okay so uh he has he's actually inherited this is right so this is is the actual FBX that I've exported from blender he's just inherited it sort of automatically recognized his material slots and automatically slotted in the materials now if we go to bones we can see that his skeleton is exactly the same as the skeleton that you normally have on on the actual mannequin right they're exactly the same and I'm just gonna oops what's sorry excuse me right okay I'm just gonna uncheck his material so we can differentiate him right and now we can check that he preview mesh right okay he's a hundred times too small right why is that so that's a problem and it's a problem that needs to expect as a problem that needs to be explained and it's good that we've got to this now okay so let's go back into blender in order to fix that problem what we need to do okay because blender and Unreal Engine don't use exactly the same scale settings okay so even though the skeleton has a relative as a scale of 1 and the mesh has a scale of 1 do you remember at the beginning we had that empty and it's scaled everything down by a hundred times right so what we need to do is we need to scale this up a hundred times right and change the unit presets in blender all right so I'm just gonna scale this guy up it's 100 and do the same for the skeleton s 100 oops excuse me s 100 I did minus 100 right so there's the mannequin and the skeletal mesh and I'm just going to change the unit presets to metric but I'm going to change the unit scale to point zero one right now this may all be a bit confusing mathematically but it works and these are the correct sayings so just trust me I've done this later times ok all right so let's try this again so export him I'm just gonna overwrite that file right and I'm gonna reinforce this guy import okay and the the image got really big but that's gonna reset itself so don't worry okay so hopefully now this is gonna work yes right okay so it's worked right so now we've got we've exported the Unreal Engine 4 Matic in out of Unreal Engine into blender and then exported him again from blender back into Unreal Engine and this is you know this is a custom well it's not a customer this is a mannequin but we've exploited him correctly all right and he works with he works with all the animations and he's basically exactly the same as the original mannequin but obviously we want a custom character okay we don't want to use the mannequin so let's take a look at getting a custom character onto the skeleton okay close this one so we don't want the mannequin anymore let's delete him now bear in mind because I have changed the scale right I'm kind of working at a hundred times larger than blenders usual unit scale right so yeah okay so just bear that in mind right so I'm gonna I'm going to append a custom character from my other file and this guy is called stickman and now he's a hundred times too small all right I'm gonna scale him up s100 okay now this is just a stickman okay so this is like a crap custom character but the reason why I'm using this very simple super super simple custom character is just to show the process of getting a custom character onto the skeleton and into Unreal Engine all right I'm gonna we're gonna go start with a simple character first and then I'm gonna talk about a more complex character afterwards all right so let's just start with a simple character now the thing is is that I've already created this character previously and this character already has right a set of vertex groups right which means that I have already assigned bone weights to all of the parts of this character right so for example if I select right lower arm okay yeah let's go with lower arm or right it's gonna select those versus okay and those bones are bound to that bone which is lower arm or right and I can rotate that okay so no I haven't bound him to the I'm bounded to the skeleton yet but he already has those vertex groups now why why why when I move the bone doesn't his Omni right was cuz he's not bound yet okay I've just I've only just imported him he does however already have an armature modifier right prett from previously now I now I can delete this armature modifier he keeps his vertex groups right he currently does not have a parent the stickman you see here it says parent he doesn't have a parent okay so the simple list so the simple thing to do to bind now to bind him as I click on the stickman and I shift select the skeleton and I press control P set parent to you now if I choose automatic weights it's going to recalculate all of those vertex groups now in this case I don't want it to do that okay I want to actually I want it to use the vertex groups he's already got okay so I'm going to do with with empty groups which means that it won't overwrite or it won't change any of the vertex group information all right so now if I click on him when we go back to the armature modifier we can see that he is bound to the object root in the armature modifier and it also has the parent root okay which is which is the skeleton alright so now we're going to pose mode and I move one of the bones you see that his arm follows there okay so we've successfully we've successfully bound this cat this custom character to the skeleton okay and that's literally it we can export him now alright and let's do that I see what happens they file export FBX and its remit will have remembered the settings from previously okay and I'm just going to call this land stickman okay and it's funny those it's got a really big icon don't worry about that's just a bug right less important stickman and I'm gonna choose the uniform Anakin and there we go no smoothing groups that's to do with the mesh nothing's new the animations most ik man has no UV set he hasn't been UV unwrapped don't worry about it those things nothing to do his goloshes right however we can open up now and you can also see that his smoothing great information is is wrong but let's not worry well actually we can take a look at fixing that in a second he's like smooth shaded which is wrong that's not how he shaded in blender so but anyway let's just check that he works with the animations right oops wrong one am I done and sorry alright but there we go he's working okay so that is a custom character that's a fully custom character it's very simple custom character but it is a custom character let's just take a look at the smoothing groups smoothing group in okay so we can fix the smoothing groups by changing the importance well we've changed the shading by changing the import options okay so I'm just going to just delete that guy and import them again and you need to open up this drop down menu you've got normal input more normal import model the default is compute more was I'm going to change that to import normals and the normal generation methods is usually the people is Mickey T space but I'm going to change that to built-in and I'll slit skeleton again there we go okay this is just another error about the shading which doesn't really matter but but that will have fixed that will have quicks the shading on his mesh right so now you can see he's all like hard shaded that is the setting that you should use when importing skeletal meshes from blender if you want to get the correct shading you should change the setting to import normals and the normal generation set method to to built-in right ok so that's worked so but this is a very simple character let's let's take a look at getting and even what getting a more complicated character in there right now obviously in in this case you know I've already you know I've already assigned all of the folks groups to the sky previously but let me just show you really quickly how to assign a focus group okay so right now if I oops lazy if I go into place made and I click on the slower arm underscore elbow I can rotate it and his arm oops okay that's because he's got the works groups and those vertex groups are correctly assigned say or arm they're right lower arm on school L and those are the vertices that are associated with it now I'm just gonna quickly show you how to now quickly show you how to assign lace alright so I'm gonna actually remove those from this vertex group just to show you how to add them back again now that I've removed them I rotate this bone you can see it his his hand still moves but his arm doesn't move anymore right because I've removed that vertex group so I'm just gonna add it back in again and all I'm gonna do is I'm just gonna select the mesh that I want to add in folks much invokes sorry in edit mode and click assign right so those vertices have now been assigned to that vertex group and I can select them and it works again okay cool so that shows how to get like really and I you know and I've manually done that for all of the pieces of this character and you you kind of you know you could use automatic group automatic weights but they kind of only work that they don't work that great it's better to do the weight you know the weight assigning manually alright and I'm just going to talk about that a bit more now with it with a slightly more complicated character okay so we don't need this guy anymore we've already got him into Unreal Engine let's look at more let's look at a more complicated character so I'm actually just going to append from another blend file okay so I've got a kind of humanoids character here and once again he's a hundred times to small scale him up 100 times and this guy is like a proper human right now once again this is a character that I've built previously and he's already been weighted to the skeleton right so we can actually and we could just do the same method again right so let's just start from the beginning again there's the mesh there's a skeleton does he have a oh he doesn't have an armature modifier and he doesn't have a parent okay but he does have the vertex groups right which means the the vertex groups have already been assigned previously all right okay so I select the mesh I select the shift selectable and it's going to object mode i select the mesh shift select skeleton control P with empty groups because he's already got the verdicts groups and now he should be bound properly and move as we would want him to move okay we can do that with any other bones alright it looks a bit janky because there's obviously there's not a proper animation but as you can see it's working right so now we've got this you know we've got this more complicated custom character I'm just gonna sit and let's try getting this guy into Unreal Engine ok so I select the mesh skeleton well export FBX it will remember the sayings we'll call this guy Elfman and we'll import him the normal methods the same and I'm going to choose the same skeleton so take second cuz he's got a lot of polygons alright let me just get like a nice oops simple material okay but he should work with the animations so let's check it out Elfman I know we go and there we go we've got a cup we've got a fully custom character fully custom humanoid character into Unreal Engine so and he's using the Unreal Engine 4 mannequin which means that he'll work with any anat with any animations right with any animations that work with the Unreal Engine 4 mannequin right so let's do a kind of let's do a quick recap of what what we've covered so far you know the thing to really the thing to really understand is that it's simpler than you think okay this you like you don't need to change anything up I know when you look at I know when you look at this skeleton you look at this skeleton for the first time after you've exported it from Unreal Engine and you're like this is not what a skeleton should look like why are all the bones pointing in weird directions and you know why aren't they want any of the bones connected or anything like that okay and it looks weird it looks like it shouldn't be like that but you really you know if you want to use the Unreal Engine for mannequin skeleton for your custom humanoid character you really don't need to change anything about the skeleton and you really shouldn't change anything about the skeleton because by changing it like if if you just like change the orientation of one of the bones right it's gonna break all it's gonna break all of your animations so you don't do that right don't do that don't edit don't edit the skeleton okay I haven't changed nothing now that's fine so and you can you know and you can add any character mesh you want right you can use you know you can have it have this character you know or you can have the stickman or you could even have you know another another character let's just get another random character from one of my folders all right so he's I think he's coming with his own skeleton so I'm just gonna delete his own skeleton well there you go there's like a custom there's a custom character like an actual proper character for a game as my my colleague I see me on this cord so there's that you know this is an actual custom character he's got a sorry excuse me he's got an armature modifier I can just add that to really make that route make his parent route now once again he's already got he's already got all the works groups he's already been weighted right now I so I can just select him my colleague right I could select him export him sci-fi soul to get back into Unreal Engine and this is all just once together shading information but he's in there right there's a sci-fi soldier that we saw there he doesn't have any textures or anything but that doesn't matter and he works with the animations right so you know that's that's a proper custom character workflow and I didn't change anything about the skeleton I mean the only thing the only thing I changed about the skeleton was that I remember at the beginning I deleted the empty and then I I deleted the empty and then I scaled the skeleton up a hundred times and I changed the unit presets to metric and the unit scale 2.01 so but that isn't actually an edit to the skeleton right so the only edit to the skeleton was scaling up a hundred times okay um so I just want to talk a little bit about about waiting right about wait about vertex groups and waiting so I'm just gonna bring back in the bring back in the simple okay hang on a second the simple human male or the elf elf male nobody's a hundred times too small size scale him up hundred times now he's already got he's already gots muriatic scrapes okay he doesn't have an armature model he doesn't have a parent he doesn't have an armature modifier but it does have vertex groups now imagine that we were doing this for the first time and we were doing it from scratch right like he didn't have any vertex groups so I'm just going to talk a little bit about one way that you could do that because obviously if you're making your own custom character you're gonna have to deal with the process of waiting of doing the wait paints right of assigning you know bone weights to the mesh to make it work right obviously with this character I've already done it previously but I'm just going to show you give you a quick introduction to how to do it from ouch okay so the first thing I'm doing I'm just gonna delete all of these works groups so he no longer has any votes groups all right so now he's got no votes groups if I select him and select that again and I do ctrl P with empty groups and I try to move him right I try to move one with bounds nothing's going to happen because he's gotten over he's now he's got vertex groups again but none of these mercs groups have any none of these works groups have any have any geometry assigned to them right so if I click on upper arm or lower arm L and I click select there's like nothing there right now manually manually assigning all of these like polygons see these works groups manually can be quite a lot of work all right now I do think it's the best way to do it right it's the way that I generally do is I do it manually right absolutely I'm gonna do that I do generally do it manually myself but I'm gonna show you another technique that's a bit simpler okay so I've just selected those I'm gonna sign that and now if I move this it's gonna move with him now obviously is hand isn't attached but that's fine okay now why I generally do it manually but there's another way that you can do it okay so I'm just going to remove and remove all his work sweeps again and I'm gonna unparent him and delete the homage modifier so once again now we've just got a mesh and a skeleton I'm select the mesh select skeleton ctrl P but this time I'm gonna do with automatic weights right and that basically means that blender is just gonna do it's gonna run an algorithm that automatically assigns vertex groups and and the science geometry to vertic groups based on the location of the bones and the closeness of the geometry to the bones okay so let's go with that with automatic weights bone weight weighting failed to find solutions for specific but for some bones okay that just means that like it just means that some vertices weren't weighted okay and we're gonna have to investigate that but now he's got very excretes and you'll find that it's probably done a reasonably good job of it's probably done a reasonably good job of assigning weights to him or has it not hang on a second okay it looks as if it hasn't worked for some reason which sucks I'm really sorry about that what has it worked might be to deal with some problems with the mesh okay I wasn't expecting that let's try but let's try with a different one okay cuz I don't know why that's happened that's just a bug don't worry about it let's try let's try with that spy character where was he he's come with his own skill and I'm just going to delete that okay so this way once again has got an armature modifier and he's got work sweeps I'm gonna delete all those groups as if we're doing it again in the beginning so all we have is a mesh and a skeleton trophy with automatic weights now that time has worked okay I don't know why it didn't work for the other mesh there's some silly bug with the other mesh I don't know what it was I could probably figure it out but let's not try that for the toriel net so now I've justice justice reassigned all of the weights to this character and it all have done a basic job it should have done a basic job of assigning verax groups to him so now of course if I rotate that okay so as you can see it's kind of done and okay it's kind of done a job but it hasn't done a perfect job right because you can see you know these these other parts are not performing properly so what you need to do is you need to go into you know you need okay so you need to basically investigate what the problems are with the weights right and the way to do that is to go into weight paint mode and in weight paint modes you can select different vertex groups right so they've lower arm twist as one and you can see where the bone influence is assigned all right so let's go let's go here so though you can see those are the vertices that have their assigned to hand L those are the verses that are assigned to hand to lower arm on school and in this mode you can actually change the weighting right so I can we've got it set to I said it's it's mix like say to add you can use mix or adds for it whatever you prefer and I can change how much I want no red means 100% influence but dark bloomin zeros in the influence now I'm not suggesting that this is a good what I'm doing here is good but you can see that I'm manually manipulating using the brush right weight painting is like it can be really helpful in some situations and it's a really useful tool to learn okay another way another way to do it is is is by assigning them in edit mode and we look to that we looked at that a little bit earlier on if you remember with the stickman so what I'm going to do is I'm just going to now one of the things that I tend to do no I want lower arm see the thing is is the automatic weights have not really done a very good job here right they've put a lot of vertices a lot of geometry into lower arm underscore L that we just really don't want right which is why I kind of suggest doing vo adding the weights manually okay so I'm actually gonna remove these alright so there's now nothing inside what I'm going to do is I'm just gonna like some I'm just gonna roughly select the parts that I want okay you know and you does require a bit of skill and a bit of practice you know you need to you need to get good at this you need to get good at this you need to practice it so that you kind of learn how these these systems work but it does you know it does work right so okay so those those are the vertices I want okay oops those are the verses or the geometry I want for lower arm now I'm just gonna sign it at 100% now and we go into vertex pay vertex paint mate sorry wait paint mode okay I've got the wrong route there don't worry about let's just just ignore that one you can see it's 100 it's just 100 percent red now the thing is you don't want it to be 100 percent red because that's gonna mean that you're gonna get this really sharp deformation okay and one of the things that you one of the tools that I use a lot in assigning weights is this thing called smooth all right you can only use it when you've enabled this one option which I believe is this one yes it is it's called vertex selection master painting wait paint only now once this is enabled you can use this option called smooth right and what this is gonna do is this just gonna like average out the weights and I'm gonna really like it's only don't want it to rotate a really small thing I'm just really gonna ramp this up to like 100 all right and you can see it's just got this rip now it's got this really nice smooth gradient between the parts yeah and it's you know and that's actually a pretty decent you know waiting now for this part of the arm and so I've done that manually by assigning the geometry selecting the geometry I want giving it 100% weight to the bone and then smoothing it out using that technique right now this is all still excuse me this is all still inside blender 2.8 as well I'm sure these these exact same techniques are in blender 2.8 they might be in slightly different locations which you'll have to find but those techniques are still definitely there so I mean you can use or you can use automatic waiting like I showed you there but I think the automatic waiting you know you're gonna find that it doesn't get great results like that's the kind of weights you want for lower arm underscore ell you know but then like let's take a look at like what we got for lower arm unschool or you know it didn't really do what we want and we got the we got the pouch you know in the verdicts grape which definitely shouldn't have been in there you know so automatic weights cause problems right I I do recommend fundamentally doing your weight painting manually if you can okay automatic weights are a good like prototyping or testing tool okay cool so in the soil we've gone over the whole business of exporting right exporting the Unreal Engine for mannequin from Unreal Engine getting it into blender as an FBX importing an FBX into blender with the the mannequin we talks about exporting the mannequin and getting that back into Unreal Engine and we talked about adding the stickman and we still talked about adding this humanoid character and then it even talks about a more complex character and how to apply weight weight painting and so on I really hope you've all found that helpful I think the the takeaway here is that it's really not as difficult as you might think and you really don't need to you don't need to edit the skeleton and you don't need to use retargeting animation retargeting and Unreal Engine 4 to get a basic humanoid character to work you know pretty much perfectly okay so let's just as you see that's a custom character he's got no textures or anything but that's cool okay so I really hope this tutorial series has been helpful I will provide some of the I'll provide the stickman in the as a download in the link description and if you have any questions please feel free to ask those questions in the comment section in the youtube video alright thanks for watching I hope you've enjoyed the tutorial and good luck with your custom characters from blender to Unreal Engine 4 alright take care bye
Info
Channel: Dyoto Orion
Views: 37,620
Rating: undefined out of 5
Keywords: Blender, Unreal Engine, Character, Rigging, UE4 Mannequin, Skeleton, Weight Painting
Id: WG83MYVAGfg
Channel Id: undefined
Length: 41min 23sec (2483 seconds)
Published: Wed Oct 16 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.