2d Mesh Deform and Rigging in Godot 3.1: Skeleton2D and Bone2D tutorial 1

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
in this tutorial we're going to see how to use the new mesh deform feature and go to 3.1 are going to see how to create a skeleton for the character using the skeleton 2d and bone to knee node and then we'll see how to create a skin to rig how a character that is to say to bind the polygons that we draw to the bones of our skeleton let's get started in the project you will find two pictures the first one is a reference of the good at but that we are going to use to place the various body parts in the viewport in the scene and the second one is an atlas of the individual body parts that will make up our character that we are going to create as polygons 2ds and that we are going to bind to our skeleton in Godot let's create a new 2d scene we are going to place the G bot reference in that scene I'm going to make it a sprite here and I will select make it transparent by going to be visibility in the inspector modulate and I'm going to lower the Alpha value to make the character half transparent can also tweak the color to make the character separate from the pictures we're going to put on top of it then in the toolbar at the top use the lock icon to lock the image this way we can't select it inadvertently we can start working on our polygons now I'm going to rename the root node of the scene good but it's going to be a no 2d and save it in my file system here the first thing we want to do is to add the individual body parts as polygons to denotes wiling to group them under a no 2d to keep them organized so select the gutted but node control a and add a node 2d there we're going to name it polygons ctrl a to add a new node under that and you to look for polygon 2d it's a know you can use to draw polygons on the screen in general but if you look into the inspector you will also see the skeleton and texture categories suggesting that we can use a texture a sprite in this case and assign the polygons to a skeleton select your debug pieces picture now going to drag and drop it into the texture slot at this point nothing will appear we have to edit to create our polygons and to do so you have to use the UV button up there in the toolbar with your polygon 2d selected click the UV button which will open a new editor I'm going to reset the zoom level here and we can get started working on the character we're going to start by creating a polygon for the tall so the first part you can work any few subcategories in this window to create polygons you want to go to the points tab then the toolbar changes and the pencil icons allow you to create the vertices that make up your polygon that's the one in the left that you are looking for click to select it then you can zoom a little bit using the zoom slider and click to create points anywhere you want to click to create individual vertices that surround your own character while I'm doing that I want to explain that this is the part that's still a little limited as far as the user experience is concerned you will not find all the tools that you have to create an edit polygons compared to major 3d package something like blender so you want to roughly surround your own character with vertices it will take a bit of practice to create the right number vertices but once you're done you cannot edit the edges you cannot split the segments at the moment so be wary of that for example I made a vertex that I didn't want to add an extra vertex on the hip make it easier to later connect the vertices on the joint the characters between the the hip and the chest once you are done creating your polygon the tool will automatically switch to the edit mode you can select and move or rotate points with that tool you can click and drag on any vertex with the arrow tool selected to move the points with that if you click on OK you will see your polygon in the view at this point you might be tempted to change the pivot points on the polygon you don't have to press the W key to select the move tool and move it on to the character Stahl so note that you can move the G bot reference and the polygon node not as part of it but can move otherwise the polygons node above it to overlay the G bot reference on top of the polygons that you are going to draw this way it will be easier to make them roughly match you want to rename your polygon nodes as well this one is going to be it's also for example from there you want to do the same for each and every body part on the character so I'm going to duplicate the node select also press control D and I'm going to call this one arm L going to use the capital letter L for the left side of the character's body and capital R for the right side to differentiate the left and right arms having conventions when you are doing animation and rigging and very strict ones in your project is quite important so that it's easy to retrieve the body parts from the code for example so with the arm L selected I'm going to click on the UV button in the toolbar make sure that I'm still in the points tab I'm going to select the polygon creation tool and I want to work on the left arm so the one that's in the background from the ring to roughly outline the arm in general I try to make the points count on one side match on the other so that it's easier to connect the polygons afterwards note that this is not mandatory but you will need some practice and fiddling with the vertex count just to make the character and the mesh deform as you'd expect on such a sprite for example it's going to be a bit hard to deform around the hand but it will be a little easier to deform around the elbow due to how the sprite is made you might want to split the hand into a separate sprite in this case it's easier when you have a real wrist but for a robot where you don't want the final animation to be too organic and the deformation you might want to separate the hands into a separate sprite bring to press ok so I've got my arm now now as we duplicated the torso here and removed and recreated the polygon guru has not generated an internal polygon for us let's go back to the UVs here and you want to go to the polygons tab this is one of the tricky parts about using the system right now when it comes to vu X we don't have a tool to fill the polygons to draw all the mesh that we want to have in the studio edge because this is a 3d object if you want or internally this is a mesh just like you would have in a program like blender in this view you can create the polygons that will make up your polygons 2d so for that you're going to connect the dots you start by clicking on one of the vertices and you click on the other vertices to connect them together there's a lot to say about creating good meshes and you will need maybe some 3d experience for that but the basic way to do it is to connect reverses that's are facing one another and to get better deformation we will see that we will need more polygons what I want to show I'm not going to fill until the end and click OK just to show you that now that we recreated the polygons we can see the parts where we creating these polygons this is because when you are working with meshes it's not like working with a sprites you need the polygons to be available somewhere to exist to map to your initial texture you're not just printing or displaying the texture on screen you are mapping it on 3d meshes and that's quite important so when you create these polygons go to create the corresponding UV coordinates for your object but when you first create a polygon to the node good-o is going to generate that for you just be wary of that if you duplicate the nodes you will have to create the polygons now this is not that big of a deal because as we'll see in a moment in order to properly use the mesh deform feature you will have to create that mesh manually most of the time right now you have to create it polygon by polygon in the future hopefully we'll have some options to generate all to match great or fill the mesh that we have here but for now we have to do it the manual way with that we've got one example of creating the torso from scratch and the arm by applique ting one of the polygons and recreating the polygons one by one I'm going to drag the arm behind it also and my hierarchy just so that it displays behind the Tulsa and with that you want to do the same for all body parts on the character I'm going to skip ahead adding every time a new polygon 2d assigning the texture to it and then creating the polygon see you in a second here we are with all the body parts created I'm going to select the polygons node and lock it but also disable the ability to select children these are the two neighboring icons in the toolbar from there even with the select all on if you click on anything in the viewport you won't be able to select it inadvertently because we are going to create the skeleton next select be good at but node press ctrl-a and search for skeleton 2 T then the skeleton itself doesn't do much you're just going to see a new menu option in the toolbar but you need bones or joints to make your skeleton work let's do that we're going to select skeleton 2d ctrl a and look for bone 2d we're going to add a number of nodes there to create our character the first one let's call it hip the little shape that you see in the view represents your bone anytime when you have the bone by itself and it doesn't connect to another joint so you can't control its length easily you can use the default length property in the inspector and increase it to make the bone bigger let's go to 70 pixels for example then the way bones work is the shape is just a helper for you to select a part of your character and easily rotate it and visualize the rotation and the scale but you are just working with a joint a point in the TD workspace let's place that point on the hip it's going to be the pivot for the hip and then we want to add a new bone as a child of this one ctrl a at a bone to z this one we'll call it also or chest for example and you can press W to move your chest pivot points at the base of the chest anytime press Q you can select the hip and move it and you will see that it's child bone moves with it if you want to move a parent just be worried that the children you'll have to replace them afterwards we're going to do the same dublicate the chest and we're going to go to the character's neck have it as a child of the chest select the neck node and move it to the neck of the character one thing you'll notice is there are warning signs next to the nodes and if you click on them it will tell you that you need a rest pose for your skeleton to D this rest pose we're going to add once we have our entire skeleton working next select the skeleton to D we're going to create the hierarchy for both arms so you can start by creating it under the skeleton to D and then nesting it into one of the nodes I'm going to do that so ctrl a to add a new bone to D putting to call it arm L and place it around the shoulder then dublicate the node call it forearm L going to move it to the elbow and finally go to a hand L node it's going to be a child a before arm that starts at the wrist then I'm going to rotate that node to have the bone pointing down in the hands position increase the length to something like 60 pixels the reason I'm rotating it is when we're going to create that rest pose this is going to register this state for the bone and for my hand L as the zeroed out position and rotation for the note which will make it very easy to reset the skeleton to that pose if we rotate the hip you will see that the bones that are children of it are going to rotate with it but not the arm for the arm to rotate with the chest in that case you want to drag the arm L and the chest and from there rotating the chest will rotate the arm so well rotating the hip but rotating the neck will not rotate the arm you want to duplicate the arm l note it's going to duplicate it with all of its children going to expand the node tree here and move that to the arm right I'm going to place the nodes first I'm always using the W key to use the move tool from the tool bar rotate the hand right and then rename the note arm l will become arm right forearm L forearm right and hand L hand right with that I'm going to skip ahead once again create the remaining parts of the skeleton to show you the setup for the legs and the head see you in a second
Info
Channel: GDQuest
Views: 79,971
Rating: undefined out of 5
Keywords: godot character animation, godot skeletal animation, godot skeleton 2d, godot 3.1 skeleton, godot rigging, godot 2d animation, godot 2d skeletal animation, godot animation tutorial, godot tutorial, godot game engine, godot 3.1, game developement, godot 2d tutorial, godot 2d character animation, godot 2d rigging, godot bone animation, godot 2d bones, godot 3.1 new features
Id: Cqp3PJQIrUc
Channel Id: undefined
Length: 16min 51sec (1011 seconds)
Published: Mon Apr 15 2019
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.