[Blender 2.8/2.9] Game-ready Rigs #3 - Rigify for Game Engines (UE4/Unity/Godot)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Additional info:

This is my manual approach for making sure Rigify rigs work well in Game Engines. I am working on a series of videos covering all of the basic problems that I experience when working with Blender for gamedev... as well as the problems that I see other people experience when browsing Reddit and other online communities.

I hope it is useful.

👍︎︎ 5 👤︎︎ u/toshicg 📅︎︎ Mar 03 2021 🗫︎ replies
Captions
hi everyone this is another chapter in the bridging the gap series in this one i'll show you how to take a rigidify rig and make it game ready i know that there are a bunch of scripts and add-ons out there that claim to do that and some of them actually work quite well i already mentioned a-rigify in earlier videos it's a paid add-on but it can be used on any regify rig many of the free scripts out there only work on the human rig actually but i'll keep testing all the scripts that i find and i'll keep you informed but right now in this video i want to show a stable reliable manual approach this approach is also versatile meaning that you can take any rigifi rig apply this workflow and it's going to work so i recommend you take the time to learn this this way you'll understand what happens under the hood and then even if you end up using an automated add-on you'll be better equipped to deal with problems if all you can do is press the button on your add-on then you may run into problems that you are not able to troubleshoot i'm not sure how you found this video but it is part of a course that i'm building a course about creating good workflows between blender and game engines i recommend watching all of the videos i'll share a link to the playlist below the video you can also get early access to these videos and other bonuses on gumroad and patreon this way you also support my effort and allow me to make more videos so the previous video was about taking any rig any non-rigidify rig and making it game ready and if you watched and understood this last video you should actually be able to make the rigify rig game ready as well because the process is basically the same there will be some rigified specific information but other than that it's the same five steps that i showed you last time you know duplicate the rig clean it up fix the hierarchy connect the rigs using constraints and that's it and that is all based on the basic principle that i keep repeating i'm not going to explain it again please watch the previous videos for that but i am showing it once more to stress that this principle is really universal it works regardless of the rig that we are working with so in this video i'm going to be demonstrating the workflow on this rig this is the two-headed auger rigging this guy is one of the modules of my rigify course in this course i show you how to go quite a bit beyond the basics of rigify i show you how to set up these belly bones that react to the leg as the leg moves up the belly bones automatically move the belly up as well there are other automated bones in the back area here they help preserve the volume in this area another thing that's automated is this armor piece it automatically rotates as it nears the head the reason i'm using this rig in this demonstration is because it's the most complex rigifi rig that i have and the idea is to show that no matter how complex the rig is the same workflow can be applied and it will work exactly the same way if you're interested in the rigify course and this two-headed ogre in particular you can get it from gumroad if you enter coupon code cd dive you'll get 15 or 20 percent off i keep forgetting the percentage that i set but anyway let's do this i'm going to clear all transforms and bring the rig in the default position in object mode i'm going to do step one of my process which is duplicating the whole armature and this armature will become the game rig so i'm going to call it auger game rig and the original one i'm going to rename to auger control rig and right away i'm going to move to step 2 which is cleaning up the game rig i want to remove everything except for the deforming bones from this rig so i'm going to select the game rig isolated go to edit mode and under the armature tab let's unhide everything all layers all layers that have anything on them and then i'm also going to press alt h just in case something is hidden i'll activate screencast keys now for rigid fire rigs i don't need to remove the widgets because in rigify only the control bones have widgets and the deforming bones which i want to leave do not have any so that's fine so now i want to delete all non-deforming bones and that is again even easier with rigify than with other random rigs however there is a little rigify specific step that we need to take now if i expand the details of the game rig there is some animation data that was copied from the original regify rig it is in two places one is right here under the armature object and another one under the armature data sometimes i'm a little bit confused by the representation of the data here in the outliner but for this rig we just need to get rid of this animation data here so i have to right click and choose clear animation data and then do it one more time for the area animation field i'm not sure why but if you don't clear this data rigidify gets confused and blender starts creating error messages in the system console and your rig will still work but these error messages can take a few seconds to process and that will slow down your scene but now you don't have to worry about this and we can continue with deleting the actual bones the reforming bones for rigify are always over here on layer 29 so if i shift click it that will disable this layer so it will hide it and now i can simply select everything and delete all bones and that will delete almost all of the bones there are these four little bones they may be more or less depending on the rig that you have that you cannot select and you cannot delete uh easily it's not that important but these bones create a little dotted line to the pole targets of the ik and because you shouldn't select them directly they're made non-selectable the way around this is to go to your outliner expand the game rig and look at the bone data if i scroll down all the way down i have a lot of deformation bones but at the very bottom there are these four v i s bones and selection is turned off for them but i can turn it on i have to have this selection toggle on in the outliner okay now they are selectable i will select them with a and delete them and they're gone so now i'm just left with the deformation bones on layer 29. for non-regify rigs you may have to double check if some bones have the deformation option on by by mistake but in riggify every bone that is on layer 29 will be definitely a deformation bone so we are all set now we want to remove all constraints from these bones that is one of the easiest steps just select all bones and press ctrl alt and c and it's done we also want to remove bendy bones if you watched my previous video you know my preferred workflow for that i could switch to b-bone to visualize the bendy bones and then just select any bone go to the bone tab and for the active bone i'm going to set the segments to 1 and simply right click on the segments area and choose copy to select it and that will make all other bones have exactly one segment which basically means no venables now i also want to check if there are any custom properties or drivers on this rig i want to remove all of them i want my game rig to be as simple as possible so here i see that this bus index field has a driver i'm going to simply right click and delete it and i'm going to check for any custom properties there are none under the object there will be one under the armature tab rigify always creates a special rig id at the armature level is used by rigify for several reasons but we don't need it in the game break so i'm going to get rid of it and for the individual bones you can also check one by one if they have any custom properties here on this middle bone i have some custom properties that i set myself for this rig these are the properties that control the automatic raising of the belly here as well but in general the default trick types in rigidify wouldn't have any custom properties and that's all for the game rig let's move to the control rig as always i want to make all bones in the control rig non-deforming so go to pose mode make sure that everything is shown press alt h as well select all bones go to pose bone settings deform disable and the other thing is to disable the bendables my active bone has exactly one segment so with all bones selected i'm going to right click and choose copy to select it and one additional thing that you may want to do for the rigifi rig is to remove its squash and stretch features as i mentioned in the previous videos squash and stretch can create problems in game rigs and i'll have a special video where i show a couple of possible solutions for squash and stretch but one of the easiest solutions is to simply avoid bone scale the actual problem behind squash stretch is bone scale and so for the arms and legs rigify has a special option called ik stretch it is on by default and that allows me to stretch the limbs but if i set it to zero then i won't be able to stretch the arms in this case so i'm going to do this for all limps so for the right arm right leg and left leg and that's how you do it for any limps that will also work with the pore rig type however one rig type that is stretchy and there is no direct way to turn it off is the spine as you can see i can stretch the spine and there are no stretch controls there is one workaround however and that is to go to the last layer and select your spine bones and each spine bone has a stretch to constraint if you select all spine bones on this layer again that's the last layer where we have the org bones then i can simply alt click on the eye icon of the stretch to constraint and that will disable the stretch tool constraint for all of these bones now if i enable the torso controls i can move this widget but the spine will not stretch this way we ensure that we won't have any scale problems in our game rig again i'll show workflows that allow squash stretch in future videos okay next i'll go back to the game rig and now i want to fix its hierarchy when it comes to working with hierarchy i think octahedral is the easiest display type it's easiest to keep track of things so i'm going to select it and then go to edit mode actually pause mode and now if i try to move my bones around to test the hierarchy nothing will happen and that is because rigify locks all transformation axes by default so just select all bones and while holding alt click each of these lock icons and that will unlock them and now i'll be able to move my bone and i can see that this bone that should move everything with it actually doesn't move anything so in edit mode i want to let's activate the x-axis mirror and then i want to select the leg belly bones and this butt bone that i have for the auger and then shift select the base of the spine and press ctrl p keep offset now the spine moves the legs with it but there are some corrective bones that i set up for the knee area that are not parented correctly so i'm going to parent this bone which controls the hamstrings and the knee bone to the thigh to this lower bone of the thigh and this bone controls the cuff i'm going to parent it to the shin these toes are not parented and i also notice that i don't have toes on the right side of the rig normally i would fix that but for this demo that's not the point so i'll just skip this part these muscle bones in the clavicle i want to turn to the last bone of the spine inside the top of the upper arm there is a special bone that is the bone that controls the shoulder armor in the beginning i told you that this shoulder armor is automated and the automation is actually on this on this little ball here so i'm going to parent this bone i'm going to scale it down a little bit more the sizing edit mode doesn't matter and i'm going to parent it to the upper arm bone with keep offset and the upper arm bone i'm going to pair onto the clavicle okay these necks i'm going to parent also to the end of the spine and let's see what we have now i think we are almost there again these corrective bones that i created for the elbow and bicep area are not parented correctly so in edit mode i'm going to select the elbow and the bicep bone and parent them to this upper arm bone and this corrective bone i'm going to parent to the first bone of the lower arm from experience i also know that fingers are not correctly parented to the palm bones so first i'm going to pair on this bat bone to the hand directly and then i'm going to hide it because it gets in the way and then parent these fingers to the pumps and the thumb i'm going to parent to the hand it's actually already parented so that's fine this ponytail should be parented to the head and as for the face bones i'm going to select all of them and parent them to their respective head so first i'm going to hide the ponytail and the neck bones and then select all bones of the face try not to miss anything disable x-axis mirror here because this is not symmetrical and then deselect any bones from the other head and face and once i'm sure that i selected all face bones i'm going to shift select the head ctrl p keep offset and i'm going to do the exact same thing on the other head i'll hide the other face to make my work easier and now just select all bones shift select the head ctrl p keep offset and i think we are in good shape seems like the neck bones are not really connected to each other so the head should be parented to the first neck bone and first neck bone to second neck bone with that the hierarchy should be correct and one quick note about uh squash and stretch again we parented all face bones directly to the head and that removed all parenting between the individual bones of the face itself and with that kind of hierarchy in the face we can actually stretch these bombs and that will be fine so fixing the hierarchy of the game rig took quite a bit longer than what we had in the previous video because rigs generated by rigify are quite complex and rigified creates a lot of constraints that inevitably affects the hierarchy and also this rig was fairly complex i would say that the average rigidify rig would be much easier to fix but anyway now we can move to the next step which is constraining the game rig to the control rig this will be done exactly the same way as in the previous videos i'm going to use my semi scripted workflow if you don't remember it from previous videos here it is i select one of the bones add a copy transforms constraint to it i set the target to be the control rig and i leave the bone field empty then this bone will kind of jump but we don't have to worry about it just keep it active and then press a to select all other bones go to pose constraints copy constraints and then i'm going to create a new text file copy and paste my script that i call link rigs and with these bones in pause mode and all of them selected i'm just going to run this script it will fill the bone fields for me and all bones will be correctly constrained as long as you follow this exact workflow this script is going to work if you change the workflow it may not work and then you'll have to do the constraining part manually okay next i want to unparent my character from the control rig i'm going to check its modifiers the armature modifier was removed but it has a corrective smooth modifier even though it's not active for games this modifier doesn't work so i'm going to get rid of it then control select the game rig and press ctrl p and choose i'm maturity form now if i go to my control rig and move it it will move everything with it the props and the other objects are not moved that is because this character consists of a couple of meshes and i have to re-parent all of them so go to object mode hide the main character body and then also hide the control rig and then i'll select everything and shift select the game rig and then ctrl p how much of the form and now for each of these objects i have to remove the armature modifier that is assigned to the control rig and also any modifiers the solidify modifier i'm actually going to apply subdivision remove now i can unhide everything try to move the control trick and everything will move with it the face control will also work that's how you prepare any riggify rig for games in this case i'm only going to show one example because it's basically always the same workflow i purposefully chose the most complex character that i had available and that offered plenty of opportunities to get into trouble and to fix them and yeah i hope that this will enable you to work with any riggify rig that you want uh if you have any trouble of course let me know in the comments on discord and so on and next i'm going to show you a cool little add-on that you can use and we are going to do a quick test of this guy to see if we can get it into unreal without any problems the tool that i mentioned is an add-on called rigify an inbox it's really cool it is free but of course if you can afford it spend some money on it that's what allows independent creators to keep creating and then once you have it you just install it like any other add-on and you'll have it in the end panel in this r a tab and it has many features and i'm going to try and make a separate video specifically for this add-on and go over all of these features but the only one that i'm going to show you now is this rigidify walk and run which is really awesome i'm going to reorganize my interface a little bit i want to have a timeline action editor and a nla for the nla i'm going to click this icon i'm going to have a video about the nla so for now i'm not going to go into any details about this so what these functions of the add-on allow you to do is to create walk cycle or a run cycle with just one click the limitation is that you have to be using a redefine rig and it has to be compliant with the human meta rig now even though this auger is quite different the spine legs and arms were actually taken from the human rig so this feature will work for my ogre so i'm going to press magic walk and choose 24 normal size that's the speed of the walk and the size of your character and just like that the ogre is working and that also created a connection for me i'm going to push it down again i'll explain these things later i'll disable this action and then i'm going to create a run as well i'm going to go for 18 frames normal size and that's it we have a run as well i'm going to push it down as well and now these sections are on the control rig i want to bake them on the game rig before i can export them this is also something that i'm going to cover in more details later but for now here is the quick workflow i'll go to the game rig pause mode select all bones press spacebar or f3 depending on your settings and search for bake action in here take all options except for clear constraints and press ok and now we have a new action i'm going to call it over room and push it down and i'll go to the control rig again untick the run action and activate the walk action go back to the game rig and bake another action and this time i want it to be 24 frames long because that's how long the walk is press ok and here we have the walk i'll call it over walk and push it down and right now our game rig is actually still controlled by the control rig so it is not really using these actions that we baked um to disconnect the game rig from the control rig temporarily we can select all bones and alt click on this eye icon okay and now if i click the star which is on the walk cycle my ogre will walk and if i click the other one he'll be running and as you can see the game rig is no longer controlled by the control rate we need to do this otherwise we won't be able to export these actions that we baked the next step is the fbx export i'll have a special chapter on this but here are the basic settings for unreal we first need to export the game and the armature without any actions and in the default pose these are my fbx settings and then we need to export another fbx with the animations the fbx settings are almost the same except that we enable bake animation and then in unreal we first drag and drop the fbx without any animations and just use the default settings and after that we drag and drop the fbx that has the animations and then we only tick the import animation box now i can place my animated character in the scene and it's working that was just a super quick overview of the export import settings we'll have a separate video for that so don't worry if it didn't make complete sense right away we are almost done with the rig preparation videos there will be one more where i show a solution for this question stretch problem so look forward to it thank you to everyone who is supporting me by watching these videos clicking like and subscribe and so on but especially to my patreon and gumroad supporters you can see their names on screen now that's it for this video talk to you soon you
Info
Channel: CGDive
Views: 12,145
Rating: undefined out of 5
Keywords:
Id: INK__p3CWUw
Channel Id: undefined
Length: 26min 56sec (1616 seconds)
Published: Wed Mar 03 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.