[Blender] Fix Wrong Bone Length / Orientation of imported Rigs

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
this is a video based on a common question that I receive and that is I imported a rig into blender usually through fbx and for example the face bones look like this like an absolute mess and the weird thing is that this rig may have been exported out of blender yeah in fact it is so this is the original rig that I exported out of blender as fbx and then I imported it back in blender through fbx something else that happens often which is basically the same problem here is another example of a rig that I imported through fbx in this case that was generated in the accurig software but it could be mixamo or it could be a rig from anywhere so if I go to the rig and go to pause mode if I grab this bone and rotate it it kind of rotates the upper arm only and then if I try to select this small bone underneath the other bones it kind of moves the whole arm so basically this bone should be the upper arm but lengthwise it is just half the length of this upper arm and it's the same here in the lower arm there's this small bone which is actually the lower arm and you may think that something is broken that something is seriously wrong with these rigs but really it isn't except only surface visual level but functionally the rig is okay and another related problem that you may encounter if you import a rig from another application the bones may be pointing in seemingly random directions I'm going to cover this at the end of the video so I'm going to do a little tldr here a quick explanation and after that I'll go into a more in-depth explanation and you can watch it if you want to so basically blender has this concept of a bone length each bone has a beginning and an end and that defines the length of the bone in this bone length does play a role inside blender especially for specific workflows that we can use but once a mesh is already bound to a bone the bone length actually doesn't matter which means that if I grab this bone for the upper arm I can go to edit mode and make sure that I'm in individual Origins and then I can scale up this bone until it's as long as the actual upper arm then go to pose mode and rotate it and it will have the exact same behavior as before I can go to edit mode and scale it down really really small and go back to pause mode and it will have the exact same behavior basically the main properties of a bone is its pivot point and the part of the mesh that it controls through vertex weights and the reason you get this incorrect bone length is because not every 3D application has this concept of bone length just like blender does my guess is that fbx does not have it and so when you get a rig like this with incorrect bone lengths you can go to edit mode and edit the length of your bones as you desire or you can just keep working with the incorrect bone lymphs again functionally that won't be a problem so for these crazy face bones all you have to do is select all of them and make sure that you don't have the head selected in the neck and then with individual Origins scale down all of these bones play this and it just scale them down you'll see that they start to assume the shape of the original rig so fixing this will be a little bit time consuming because some bones need to be shorter and and others need to be longer but if you need to do it you can do it just keep scaling up and down so let's take it a little bit slower now and try to understand what a bone is in blender so if I just create a single bone this is what it looks like this so-called octahedral shape and it has a thick end and a thin end the thick part is the start of the bone and it's called The Head and the thin part is called tail and it's the end of the bone and the thick part is also the pivot point if we go to pose mode and rotate this bone around you'll see that it rotates around its head so head and tail are very important terms in blender rigging if you go to edit mode I'm using the Spy menu but you can switch from here edit mode so if you go to edit mode and panel item you see that you have head and tail parameters and these are just the positions of the head and tail in World space so if I change this x y z values for the head it will move in space and same for the tail so the distance between head and tail is the bone length we even have a value here called bone length if I tweak it my bone will become longer and simultaneously its tail values will be tweaked and also if I tweak detail values you'll see that the length of the bone changes in something surprising about bone length is that it does not matter that much it's nice and it gives a visual cue about the quote-unquote bones that we are working with and it also helps in the automatic weights algorithm to create good weights for us so for example here I have two armatures and both amateurs are a chain of three parented bones okay same here the difference is the bone sizes so if I parent this with automatic weights and this one as well and go to pose mode you'll see that the results that I'm getting from the deformations from the automatic weights are very different so bone length can be useful inside blender for enabling certain workflows but essentially a bone can be defined only by its head because the head is the pivot point of rotation of the bone for example once I have set the weights for this cylinder I can go to this rig edit mode and first I need to disconnect alt B and disconnect the bones and then I can select all of them and make them smaller just like the other Armature go back to pose mode and I'll still have the same deformation as before that is because at the end of the day the bone is defined by its third point and the vertices that it affects through vertex weights and if you need to understand vertex weights I have a little beginner series about that I'm going to share a link to it okay again bone length does not matter once the weights are set I can also go to edit mode and make these bones really big and you'll see that the effect is the same so a bone in 3D software even in blender is essentially a pivot point blender chooses to implement a length component for various reasons 3ds Max is kind of similar in that regard but Maya for example as far as I know because I don't have a lot of experience with Maya but it has joints rather than bones so in Maya you can actually see a bone that is literally just a point now in Maya you can also see bone-like shapes but these are just lines drawn between two parented joints and so they also indicate the parenting between the bones Unreal Engine is kind of similar to Maya but to me the way it throws the bone is counter intuitive but that's a topic for another video so by now you should understand that a bone is mainly defined by its pivot point and that different 3D applications draw or represent bones differently and if you get that you should start to understand why we get such results when we import rigs through fbx unlike blender fbx has no idea about bone length and so blenders fbx importer tries to guess how long a bone should be that is usually done based on the parenting of the bones but sometimes it gets it wrong and this is especially pronounced in bones at the bottom of the hierarchy because now there is nothing to suggest their length okay a somewhat related topic is leaf bones if I select this Armature which is the original blender Armature that I have and go to file export fvx under Armature there is this Ed Leaf bones setting and it is on by default you may have reasons to keep it on but personally I always turn it off and so this result that we got here with the huge Facebook face bones that was because I exported this rig without Leaf bones now if I select a string and export an fbx with Leaf bones and now I'm going to import it again and again under Armature um I'm not going to click the ignore Leaf bone option I highly recommend that you leave this setting unchecked because if you enable it it may end up removing bones that are not really leave Bones it may make a mistake so this setting is dangerous keep that in mind now I'm going to import with these settings you know if we look at this rig you'll see that bone lens actually look much better but now the problem is that all of these Leaf bones were added and now we either have to manually delete them or just leave them like this again functionally they won't create a problem it's just that they get in the way and so when it comes to Leaf bones my recommendation is to export without adding Leaf bones and also import without removing the leaf bones that will create these um inconsistent bone lengths but I think bone lengths are easier to manage than Leaf bones another workflow is that you do export leave Bones and then use this option to remove leaf Bones on import but again I do not recommend this because you may end up removing actual functional bones at the end let's also talk about this mess here sometimes you may import a rig and see the bones pointing in weird directions this only happens when the rig came from another application it will never happen if the original application where the rig was created was blender and the main reason for this is that in blender the length of the bone is always along the y-axis this is called the primary axis okay so if I take this unreal mannequin here that I imported and I go to edit mode you can just create a new bone and move it to the side so this is our default bone in blender and if I go to Armature tab viewport display and enable access and the X-ray so that you can see through the bone you'll see that the length of the bone is along the y-axis and this is an unbreakable rule in blender if I rotate this bone the length will always be aligned with the y-axis okay so let's take a look at these bones that we imported from unreal again this is not just a problem with unreal it can happen with other applications as well so I'm going to enable access and you see that while this bone is visually pointing in the wrong direction it is aligned with the y-axis of the bone so what is happening is that in the original application the primary axis was the x-axis and to keep compatibility with the original application blender Imports the bones with the original orientations which forces it to display the bone in the wrong direction again the advantage that this has is that it keeps the rig compatible with the original application so if you intend to move back and forth between blender and unreal for example in this case then you have to find a way to work with these weirdly oriented bones now I'm going to show you one way to fix these orientations it has a drawback and I'm going to explain that as I go along so let's go to object node and just move this rig out of the way and I'm going to import the same model basically from unreal here it is and now under Armature in the fbx import settings I'm going to tick the automatic bone orientation setting just enable it and click import fbx okay I'm just going to delete some of these lods okay and now you see that all of the bones are oriented in a way that makes sense the bone lens are again kind of messed up but we already covered that but the main disadvantage of this technique is that if I go to pulse mode for example and enable access you'll see that blender basically changed the default orientation of these bones so that they look good in blender and that they're more usable in blender but as a drawback since these axes are different if I now animate this um skeleton in blender and Export the animation to Unreal the animation will look horrendous and here is an example of what this looks like that I created while testing this stuff and there is a way to have your cake and eat it too and by that I mean that I can have this rig with the nicely oriented bones as a control rig and the one with the weird orientations is an export rig and basically I need to constrain the export rig to the control rig and the whole process is not too difficult but it will take some time so I'm not going to demonstrate it in this video but if you're interested let me know and I may cover it in a future video so for now I'll leave it at that as always big thanks to all of my viewers and supporters please click like subscribe and I'll talk to you in another video thank you
Info
Channel: CGDive (Blender Rigging Tuts)
Views: 30,342
Rating: undefined out of 5
Keywords: blender3d, b3d, rigging
Id: 5wKGXkE4nyU
Channel Id: undefined
Length: 15min 46sec (946 seconds)
Published: Wed Nov 30 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.