[Blender 2.8/2.9] Game-ready Rigs #1 - (UE4/Unity/Godot)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Awesome stuff. Subscribed for sure.

I've got some mechanoid enemies I need to model and animate soon so these kinds of resources are great.

👍︎︎ 2 👤︎︎ u/NoNeutrality 📅︎︎ Feb 10 2021 🗫︎ replies
Captions
hey this is part of my bridging the gap series where we aim to create solid workflows for exporting rigged characters between blender and game engines this is an ongoing course so it's best to watch it from the start i'm placing all related videos in a playlist which you'll find in the video description you can also support me by buying this course on gumroad or patreon i'm putting a lot of effort into this course just as if it was a paid course but i'm releasing it for free and i'm counting on people who can afford it and who want to support me to support me thanks guys but my goal here is to show you how to make your characters game ready and then actually export them to a game engine and in the next couple of videos we'll be talking about rigging in particular we'll learn what a game-ready rig is and how to create it i already gave a general overview of this in the fundamentals video which is the first main video in this series and if you haven't watched it yet please do watch it and then come back to this video after that to recap the information from the previous video you have to always keep in mind that just because something works in blender that doesn't mean that it will work in a game engine there is an almost endless list of things that won't transfer reliably to a game engine your rig controls constraints drivers most modifiers bendy bones and so on and so on so it's actually simpler to tell you what you can export your character mesh or meshes will be exported your deforming bones and their hierarchy will be exported the rig controls from blender can be exported but they shouldn't be because after export they will lose their functionality and that will just bloat your character with unnecessary bones and even worse they can mess up the hierarchy of the armature and that creates all sorts of trouble which we want to avoid and so this will be the topic of this video we'll learn how to create a clear separation between the game rig which is basically the deforming bones and the control rig which helps us pose and animate the character easily in blender once we understand and create this kind of separation exporting the game rig is easy another thing that will be exported is the bone weights which are the connection between the character mesh and the deforming bones here for example you can see that this bone has influence over the lower arm and that is why when we move this bone the mesh deforms with it if you don't understand this stuff please watch my weight painting videos on youtube but these weights or influences will be exported to the game engine we can actually optimize the weights for game engines but that is another topic for another video and for now we don't have to worry too much about it and finally shape keys or blend shapes as they are called in other software may or may not be exported that will depend on the export file format and the engine again this is a topic for another video i already introduced you to the main topic of this in the next couple of videos which is creating a clear separation between a game rig and a control rig i may also call the game rig export rig or deform rig it will mean the same the control rig can also be called animation rig in the fundamentals video i actually already presented one way to create this kind of separation between the game rig and the control rig if you remember that was the tgt solution which i learned from perix rigging course and this technique is great it works but i did some thinking and some experimenting i also discussed this with my smart friends which is always a good idea and i decided to take another approach you can actually split the rig into two armature objects one for the game rig and one for the control ring the solution with a single rig is great when you're building your own rig from scratch but it becomes a little bit more complicated when you're trying to edit an existing rig and you're trying to make it game ready the option with two rigs is a little bit more versatile and it's kind of neat it's easy to explain and it's easy to keep track of things and so i decided to go with this solution because i want to cover this problem of creating game ready rigs from a couple of different angles one is building your own rig from scratch another is taking an existing blender rig and tweaking it to become game ready whether you made this rig yourself or maybe you downloaded it or bought it from somewhere a special case of pre-existing rig is riggify i want to cover that as well and another special case is a character that you exported from a game engine in protein to blender and the solution with two armature objects covers all of these cases nicely so that's why i decided to go with it okay let's look at the basic principle of this workflow don't worry if it doesn't make sense right away in a second we'll do a little practice and i think it will make sense after that so it looks like this we have a game rig which consists of deforming bones that apparent it in the exact hierarchy that we need for a game usually that would be a logical hierarchy so the lower arm is parented to the upper arm upper arm to clavicle clavicle to chest and so on all we'll do here is simple parenting and our character will be directly deformed by this game rig on top of the game rig we'll create the control rig the control rig consists of non-deforming bones it can have whatever constraints and drivers and controls that you need to make your rig easy to animate with this rig can also have whatever hierarchy you want it really doesn't matter as long as the rig works well and will create a connection between these two rigs using only constraints and no parenting the constraints will make the deform rig move with the control rig but by avoiding any parenting between these two layers we'll ensure that they stay separate and nothing is messing up the hierarchy of the game rig as i said let's go into a little practice now and i think what i just said will start to make sense i'll be using my trusty blue guy here with tail and ears for the most part i'm going to create the exact same armature for this guy as i did in the intro to blend the armatures video so i'm going to go a little bit faster through some of this process if you need a slower version you can watch the armatures video okay so i'll start by creating a new single bone in edit mode activate in front and then from this bone i'm going to start building something that resembles the leg armature i'll let the spine extrude neck and head from it i'll create the clavicle and the arm as well i'm also going to need a tail and ears you may notice that i didn't add any pelvis bones in this area that is because i want to keep my game rig light and simple now i'm going to name my bones properly you're going to see the names that i'm going to use off to the side you can also give those bones different names but do add the dot l suffix to all bones that are going to be symmetrical okay i haven't parented the different parts of my armature yet so i'm going to do that now the leg and tail will be parented to this bottom of the spine with keep offset clavicle to chest and upper arm to clavicle and finally ear to head you can verify your parenting in pause mode the bottom of the spine should move everything with it now switch to edit mode select all bones and symmetrize now i can go to object mode and let's name our armature game rig here i should say that i'm keeping things very general in this part for unreal we may actually need to keep the name of this armature to armature because unreal works better that way we may want a root bone in the game rig or we may not want one so i'm sticking to a very generalized workflow and then we'll make small adjustments later when we are trying to export to a specific game engine or for a specific effect i think it's a good idea to focus on one thing at a time and right now we are focusing on creating an armature that will work in most game engines so with that our work on the game rig is actually done i'm going to parent this mesh to the game rig with auto weights now this rig is going to need some weight painting if we wanted it to deform better but that's not the point of this video so i'm going to stick with the automatic weights if you need to learn about weight painting please watch my series on the topic and so this is the game rig or the form rig it consists of simple bones with simple parenting and the mesh is attached to it through vertex weights these bones will deform the character i noticed that one of my ears wasn't symmetrized let's see what happened i'll go to edit mode and yeah i forgot to name it properly here dot l and then i'm going to symmetrize it and then i'll parent again with automatic weights alright we can start building the control rig for that purpose i'm going to go to object mode select my game rig and simply duplicate it with shift d and i'm going to rename the new rig to control rig since this is the control rig we can now go ahead and start adding whatever controls we want to it but first let's establish the connection between the game rig and the control rig this will be done using constraints as we said to be precise we'll be using the copy transforms constraint so i'll go to the game rig and enter pose mode and i'll just select any bone let's say the thigh bone here then i'll go to the bone constraints tab and i'll add a new copy transforms constraint for the target i want the the control rig and my leg will jump kind of weirdly if you don't want that to happen you can switch to rest position for for the game rig temporarily you have to remember to go back to post position when you're done setting up the constraints but anyway we set the target to be the control rig and now we have to specify which bone of this control rig will actually be used as a target for this constraint and that is the bone from the control rig that has the exact same name as this bone that i'm working with right now so if i just press f2 to rename the bone that will give me the name of this bone i can now copy it with ctrl c and i could paste it into the bone area the default options are okay as they are since we duplicated the whole armature each of the corresponding bones has the exact same name so here for thigh dot l of the game rig i want to constrain it to thigh.l in the control rig and that won't take too much time but i can make things even faster if i use a script i'm going to include this script in the patreon and the gamer files but you can just copy it from here it's just five lines the script doesn't uh do all the work for me though i have to do a little bit of preparation so i'm going to delete this constraint add a new copy transforms set the target to control rig and then in this state without setting the actual bone i'm going to press a to select all of the other bones and with this bone currently highlighted and i'm going to go to pose constraints copy constraints two selected bones and now all of my bones have this copy transform constraint with the target set and the bone not yet set now i'm going to press a to select all bones and simply run my script and as you can see the script populated the bone fields okay now i can go to object mode switch to my control rig before that i'm going to set my game rig again to post position so that it can move then i can switch to the control rig and now if i go to pause mode and move the control rig you'll see that the game rig is being controlled by the control rig awesome so now i can start adding actual controls on top of the control rig and as long as i don't change these initial bones too much the connection between the two rigs will stay intact a little bit later i'll show you what you can do if you decide to change the deform armature after the fact but for now i'll add ik to my leg um again i'll do it exactly as i did it in the intro to armatures video so please watch that if you need step by step instructions i'll add my ik target and set up the ik here i'm going to disconnect the foot from the shin and constrained it to the shin instead and i'm going to parent the foot to the ik target we are already changing the hierarchy of this control rig but we don't have to worry because the game rig stays unchanged i'll add a poll target and now i'm going to set up the other leg the exact same way now i'm going to add a root bone and the pelvis control now i'm going to parent the legs and the spine to the to the pelvis the pelvis control and ik controls i want to parent to the root pulse i could parent to the ig target if i wanted to as you can see despite all of the changes we still have a perfect connection between the two rigs and now we can keep going and add more controls to the rig you can go as far as your rigging skills allow you but that's not the point here to be honest as you probably know my preferred way of reading is using rigify and i'll also cover how to make rigify game ready in one of the next videos but you may be wondering what if i wanted to make a change that will alter the structure of the game rig itself maybe i suddenly realized that i want a twist bone in the lower arm you know when you rotate the the hand on its own axis quite a lot you get what is called the candy wrapper effect where the the wrist loses a lot of volume and we can maybe improve that with weight painting but a better way to solve this is to divide the lower arm into at least two bones and make the lower part of the lower arm rotate based on the rotation of the hand itself and so let's clear the transforms here i'll go to the game ring first go to edit mode and um on the armature let's switch the display type to something else let's say stick this way we can easily distinguish between our game rig and our control ring but i'm going to select the lower arm and the one on the other side and right click and subdivide them that will give me two bones and let's check the names this bone kept the original name and this one got the 0 0 1 suffix that's good and same thing on the other side let's go to the control rig now again edit mode and subdivide these two bones as well and let's check the names and they changed in the exact same way so that's perfect now i'm going to go back to the game rig and because i created new bones i want to re-parent my mesh to this rig with automatic weights that will include the newly created bones then i can go to the game rig pose mode and i don't have a constraint for this bone so i can shift select the previous bone and copy its constraint and then instead of lower arm dot l i just want to change that to dot zero zero one and same thing on the other side copy the constraint change this to zero zero one and now the newly created bones should again be synced with the control rig now let's go to the control rig and try moving them and i can see that the deformations are working to create the twist in the lower arm i'm sure there are many ways to do that but i'm going to do it like this i'll go to edit mode and i'll activate x mirror over here in the options actually no i'll turn it off for a second and i'm going to duplicate this bone and make it longer i'll make it snap to the end of the lower arm like this and now i'm going to rename this to something like mch lower arm dot l and symmetrize it and now i'm going to turn x axis mirror on again and now i want to parent my hand and both lower arm bones to the mch bone ctrl p keep offset now this bone controls the lower arm i'm going to hide it for a second and then i'm going to select the hand shift select the second bone of the lower arm and press ctrl shift c and choose copy rotation now i'm going to set up the copy rotation constraint i only want it to be active on the y axis and i want it to be local space to local space let's see how this works if i now rotate the arm the second part of the lower arm will rotate with it and maybe it's rotating too much so i'm going to reduce the influence a little bit we can definitely improve this transition with weight painting but again that's not the point let's just do the same thing on the other side and we can move on so that was just a quick demonstration to show you that you can change the design of your rig at any point although it is better to plan the exact design of your rig in advance i think this would be enough to demonstrate the workflow one thing that we could do or should do is make sure that the control rig consists of non-deforming bones here that's actually not strictly necessary because this rig the control rig will never be directly parented or weighted to the mesh but it is good practice so let's do it what i have to do is go to the control rig pause mode select the bone and if i look under the bone tab i'll find this deform option and it is ticked for all bones the reform option in blender is always on by default so you have to turn it off manually for non-deforming bones if i just press a to select all bones i can then go to pause bone settings deform and from this menu at the bottom i'm going to choose disable okay and then that will disable the deform option for all of these bones i hope this illustrates the principle that i was trying to convey let's look at it again it should make sense now but if it doesn't please let me know what part you're having trouble with so i'll go to object mode and here we have our game rig as i said earlier it consists of deforming bones that are parented in a nice hierarchy and that's exactly what we did here and then we have our control rig this rig consists of non-deforming bones this rig has different constraints like the ik constraint that we set up or this arm twist while setting up the constraints we did mess up the hierarchy of these bones but that's okay because the hierarchy of the game rig was not changed here we can do anything that helps us animate this character if you understand this it should be clear that it doesn't really matter if we use one rig or two rigs the tgt solution from pyrik that i showed you in the previous video was just a slight variation of this same principle basically there is no way around it if we want a rig that is easy to animate but also can be exported cleanly to a game engine we have to establish a clear boundary between the bones that will be exported and the ones that won't be and that is done by constraining the game bones to the control bones and avoiding any parent child relationship between them the two rigs solution makes this very easy because it is actually impossible to parent a bone from one armature to a bone in another armature so that prevents accidental mistakes it's also visually clear what's what whereas having everything all bones in the same armature will make your rig more complex and you have to be more careful how you organize your bones on different layers using two rigs also makes exporting the game rig a little bit easier in my opinion again it makes accidental mistakes less likely one drawback of this technique is that the animations or actions are stored on the control rig so we have to bake them to the game rig before we can export them that wouldn't be necessary using one rig so there are pros and cons of each technique but i would say that using two separate rigs is preferable especially for people with less experience once you gain some experience you'll develop your own preferences and you can do whatever you like by the way you probably noticed that we kept a perfect copy of the game rig in the control armature you know we have a head bone in the game rig and a head bone in the control ring clavicle in the game rig and clavicle in the control one and so on and we constrained each bone from the game rig to the corresponding bone in the control rig but that's not absolutely necessary i did this again because it's a neat way to organize things but the control armature can have any structure you want as long as it moves the game armature in a predictable way just thought i'd mention this quickly that's it for this chapter once you have your game rig and your control rig set up you would start animating the control rig once you're done with the animations you would bake those animations to the game rig and then you can export the game rig and the character and just leave the control rig aside i'm going to talk about all of these things and more in future videos in the next video i'm going to show you how to take an existing rig and make it ready for export to a game engine but even if that is your goal i think going through this chapter wasn't a waste of time the goal of this video was to understand the basic principle that i repeated a couple of times once you understand it it will make everything else much easier that's all for this video please consider supporting me on gumroad or patreon that makes making these videos possible thank you to the people who are already supporting me you can see their names on the screen now please click like and subscribe that also helps a lot and talk to you next time
Info
Channel: CGDive
Views: 24,392
Rating: undefined out of 5
Keywords:
Id: hdGkKbtQxE0
Channel Id: undefined
Length: 25min 11sec (1511 seconds)
Published: Wed Feb 10 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.