Godot 4 Gets Animation Retargeting and Animation Libraries OH MY! | Lets Look At Godot 4!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey guys this is mitch with fine point cgi and today we're going to talk about godot getting animation retargeting in 4.0 alpha 13. now this is really big because animation targeting basically means that you can have multiple characters and all have them share animations previously in godot you would have to have multiple animation sets for each character so each character would have to have a run animation a walk animation a dodge animation things like that whatever kind of animations you would need each individual character would have to have those animations and you'd have to manage each one of those individually whereas now godot gains this new thing called a animation library which basically allows you to share animations between characters but that doesn't just stop there you need to be able to retarget those animations to match different sized characters different characters characters of different shapes and sizes all have different bone structures so you need to be able to retarget those animations and that's basically the feature that godot got so now that we know how animation retargeting works let's take a look at how to do it inside of godot 4.0 okay so i know this is probably not what you were expecting we're not exactly in godot we are in blender to start this off but you can see here i have a character with an animation attached to it and you can also see that i have a couple other animations here it looks like they're reloading a gun they are you know running from side to side things like that so i have a character with a bunch of animations attached to it okay and inside of godot i have a character right here called the boss which is a miximo character and if you guys don't know what miximo is but basically it's a service that adobe provides for free which has a couple of characters and lots of animations that you can use for free with your adobe account as and you don't have to pay for an adobe account you just create an account and you have access to it now this is a character from mixamo right here so we are going to use this and we're going to retarget animations from this guy to this guy okay and you can see if i scroll down he has no animations now first in blender i need to take this character and i need to export him out for it to work now at the time of recording there is a bug with the blender 2g ltf system in godot where it doesn't apply the bone scaling if i remember correctly and it messes up the animation retargeting so what i'm going to do is i'm going to go to file export fbx and i'm going to export my fbx into my animations godot tutorial we will export that out and i will come back to get out and godot should recognize it in a second and then import it all right so now that godot has imported it let's double click on our character.fbx and it's going to pre-import it and scale it up here for me so i can actually open up my import menu you'll see right here this is my import menu now how we do animation retargeting is we need to tell our skeleton to map to godot's skeletal system okay so godot actually has an internal skeletal um naming structure that we need to link this to so if we click on our skeleton 3d right here we have this thing called retarget bone map and this is where we're going to actually retarget our bones so if we come over here we click on our empty and we do new bone map you will see that we have a group a profile a bone map a resource and then we have all sorts of stuff down here and we'll go through all of these things and at least i'll explain what i understand them to be because some of these are they don't have descriptions or any kind of documentation so i'm going to go through and try my best here so starting from the top group is empty at first import and basically this will be where you choose your different groups and things like that for your bone mapping under profile you see it says empty if we click that we have two profiles we have the skeleton profile and we have the skeleton profile humanoid skeleton profile allows you to map bones to other bones that are non-humanoid so for instance if you had a car or if you had a dog if you had if you wanted to map a dog's animations to a squirrel you could using the skeleton profile you can see here you have like root bones and scale bones and you can add different groups and different bone elements and actually like hook up your bones and stuff like that this is probably a little bit too advanced for this tutorial but this is how you would map your actual bones on a non-bipedal character now in our case we are going to be doing specifically a bipedal character so we're going to get rid of this profile we're going to select and select a new skeleton profile humanoid and you'll see that it pops up with a body here now under group you can see we have body face left hand and right hand and basically that's to map all of our bones so now that you have a basic understanding of how this works how do we map a bone well if we click on this little guy here you'll see it says head right here if we come over here you can click on this and it'll show you all of your bones and i know some of them are cut off but there's all of my bones here now if we come up here to the top you can see there is a miximo rig head so if i click on that you will see that it's turned green that means that that bone has been mapped to the head bone of the godot internal skeleton so now we can click on the next one and go neck and there's neck and then we click on upper chest and in my case that's spine two if we click on chest that is spine one and if we click on spine that is spine and if we click on hips that's hips and you can kind of see how this works so right upper leg let's see if we can find that one real quick and it is difficult to find all of these objects because there are a bunch of bones here so it'd be nice if maybe we could like type search or something like that but as of right now this is how it works so right leg and then right foot and right toe base and basically that's how you map these guys now once you have this fully mapped and i already have one that's fully mapped so i'll just load that but once you have that fully mapped if you come over to face you can map your face so you click right eye right eye left eye left eye that's right eye whoops left eye like that and then if you go to left hand you can map all of your your thumbs so you have your left thumb left index and you can see how it kind of flows out from there so that's kind of the gist of how to map your bones okay and if you make a mistake for instance left upper leg and i choose something like right upper leg like that you'll see that it highlights red to tell you that you made a mistake somewhere either two bones are mapped to the same thing or maybe it's it's not matching the query match that this would expect so for instance it says right instead of left so it's highlighting red to say hey you made a mistake somewhere now once you have your bone map done i always suggest that you right click your bone map and you save it and if you save it it's going to save it out to your disk so that way you have access to it later so i'm going to map these guys and i'm going to be right back all right i'm going to right click my bone map i am going to save it and i'm going to name it mix ammo bone map dot tres and i am going to save that so that should make a miximo bone map there we go you can see it has our bone map right here so now that we've saved our miximo bone map let's talk about some of the features here in this little um section here there is a bunch of options here and a lot of them i'm not fully sure how they work but i can give you a best rough approximation of how they work now the first one here under remove tracks is accept bone transform except bone transform basically will remove tracts when there isn't a bone transform so it just eliminates those tracts that can be useful if you know you want to optimize your animations you can just basically remove tracks that aren't there unimportant positions if there are positions that are not deemed important so they're you know not being used or they're just not changing at all then it will remove the intermediary tracks between to optimize your animation unmapped bones if you have all of your bones mapped that matter this will eliminate any tracks that of bones that are not mapped to your character so this is useful if you don't need that extra bit of animation for instance some characters may need a facial animation some characters may not so unmapped bones will eliminate those facial animations if it's not mapped to anything so that's something to keep in mind bone renamer is important because it's going to rename your bones so that they match the internal bone system now some people may or may not want their bones renamed so that's what this options for unique node this is important a unique node basically means that the scene is unique so that way every time you duplicate this character it's going to have a unique bone structure in this case that's probably for the best because we're going to be doing animation retargeting so you might want to keep this on however there are some cases where you might not skeleton name allows you to rename your skeleton i think it's fine as long as everything maintains the same skeleton name which in this case is general skeleton then it's going to be totally fine to change this so basically as long as everything's named the same you're good to go reset fixer basically this will overwrite your access and normalize your positions so basically if you have a character that's taller or characters that's shorter it's going to try to normalize those those bone rotations and translations to basically allow your animation to work on characters that are short and stubby and characters that are super tall and skinny more or less so this normalizes the positions and this overwrites the axes and recalculates your bone rolls fix silhouette now this is important if you have a character that is at a a pose and another character that's a t-pose this can snap it and fix that silhouette which can help with maintaining consistency between your characters so now that we've gone through all of these different options here let's click the re-import button and let's let this re-import all right so now we have a character here and we have another character here right the boss we need to tell character to become an animation library okay so in godot you have to have a character that's skinned for this to work so that's the reason why i chose a character such as that little robot guy to be kind of my skin i guess you could say so i can make an animation library so if we come over to our character and we go up to our import and we come down here to import as and we change it to animation library this will allow us to change this take out the mesh and just keep the bones so we could use those animations across multiple characters so let's click the reimport button and it's going to say hey because you're changing the type of an imported file we're going to need to reboot godot so let's click save scenes and re-import so we'll click that and i will be right back all right now that godot has been rebooted you can see here that character.fbx the icon has actually changed you see it's a little tiny looks like a film reel almost and it looks like there's three of them and that basically tells you that it is an animation library and not an actual scene anymore so that basically means that our character got removed and it just has the animation library that was at the bottom of our little import so let's apply that animation to our boss the boss character here so if we double click on the boss and i'll need to rescale this real quick there we go you guys can actually see what's going on here if i click on the skeleton and i go to our bone map and i right click our bone map and i load our bone map and i take our miximo bone map and let's actually open this up just like that you'll see that if we click on it all of our bones mapped properly because this is a mixamo character so it's pretty simple it maps just perfectly fine to another miximo character see you can see how we have all green right here if we click re-import and then we right-click our boss and we make a new inherited scene you will see here is the boss just like that now if we want to apply the animations from our character to our boss what we can do is we can scroll down here to our animation player here we can click on it and then we can come over to animation right here we can select it and click manage animations now this is where there's a slight confusion on my part there's add library and load library ad library allows you to create a new library and load library allows you to load an existing library originally i immediately clicked on add library because i thought i'm just adding a library but it turns out that's if you want to add a new library so that's just something to keep in mind maybe that should be changed to new or something like that but if i click on load library you will see that i have all of my scenes and all of my things available to me now i can't just import a scene it doesn't work that way it has to be an animation library so i'm going to click on my character and i will click open and you will see that it has imported all of those animations that i had on that character so if we click ok and then we click on our animations you'll see that there are all of our animations right here so if i click on the first one you'll see that he is broken see that which was not supposed to happen but that's a good thing so that means that something is wrong so now we've got to figure out what's going on it's either the bone mapping of the boss to the bone mapper or it's the character to the bone mapper we'll have to figure it out so first let's double click on the boss.fbx and click on skeleton and let's see what happens if we enable a silhouette fix and hit reimport and let's see if that fixes it so we have to close this don't save let's right click new instance and click on here manage animations and godot is about to crash i'm fairly certain yep it's about to crash there we go and i'm gonna reopen godot so i will be right back all right so i figured out what the issue was so you can see here this character now has the animations of the other character of this actual character here so what the bug ended up being was a mistake on my part but basically when you export out your character.fbx you need to make sure that it is an a pose that it is in t pose or else the animation remapping isn't going to work if you think about it basically what happens when you create your bone map is it is taking this character's position and then matching it up to this guy's initial position so if you see how this armature on import is a t pose right if i scale this down a tiny bit so you guys can see it this characters in t pose right here so so the character when you import them needs to also be in t pose or else it's not going to work they need to match their poses or else it just doesn't work so that's something to keep in mind but now you can see this guy has all of the animations of this character so let's see how this works with another character so i can kind of show you the general workflow once you have everything set up so i'm going to go out to miximo real quick and you'll see that they have all sorts of animations and they have a character here that you can use so if i for instance if i click on crouch stand you can see he's crouching and stands now if you click up here on characters you can see that there are a bunch of characters that are free for you to use in your game so for instance if you wanted like a swat guy there is a swat guy that you can use if you want to use like a survivor or maybe a crypto crypto guy which does not look like bitcoin but that's fine um but in my case i'm just gonna select this swat guy here because i guess that would make sense for a swat guy to have you know some form of um weapons animations so i'm going to select this guy and i'm going to pause his animation and i'm going to get rid of his animation so you can see he is sitting in t-pose like this okay and then i'm going to download him and i'm going to grab him in t-pose and i'm going to grab him as an fbx and i'm going to download him so it's going to take a second so i will be right back all right now that i have it downloaded right here i'm going to drag this in to godot we are going to drag it in and godot should import it immediately so once godot has this imported we can double click on it to pre-import the scene and you will see that we have ourselves a little swat guy so now i can come in here i can go into his skeleton i can go into his bone map and i can actually map his bones now if his bones are different i just need to create a new bone map if his bones are not different which in this case he's not because he's from mixamo i can just load my previous bone map so i'm going to click load and i'm going to click on miximo bone map which this little bone map here is going to be provided to you guys there's a link in the description below that way if you guys have a mixamo rigged character you don't have to create your own bone map because mapping bones is kind of a pain so i will provide this to you guys so click open and then click reimport and it's going to take a second so i will be right back all right now that we've got that done first i'm going to save this scene here with this boss so we'll just save him like so and i'm going to actually import our character here as a new inherited scene just like that and i'm going to click on my animation player click on my animation click on manage animations i'm going to load my library and i will load my character animation here we'll click open and click ok now if i come in here and i click on my character armature animation you can see that the animations have imported just like that so now i have this one repository of animations instead of having multiple repositories of animations and this is big because it really simplifies how everything is put together so what do you guys think do you guys like animation retargeting do you think that this is going to be useful in the future i personally think it's basically a game changer for godot in 3d it actually makes it into an engine that's worth using for 3d that was one of the big struggles and one of the reasons why i haven't been doing any 3d tutorials is because 3d support inside of godot is not very good and with godot 4 they're making a lot of quality life changes that are making it better animation retargeting being one of them so what do you guys think let me know in the comments below because i'd love to hear you guys opinion but that is all i have for you guys today so if you like this video go and hit that like button hey if you dislike this video go and hit that dislike button because i'm here to make content for you guys this video as with all of my videos was a viewer suggested video so if you have any suggestions please leave the comments below i'll be more than happy to take a look at them and put them on my trello board and you know get to them and hey if you have any questions or comments about this leave them in the comments below or hit me up on my discord link is in the description and i'll be more than happy to work with you through any issues you might have but that is all i have for you guys today so thank you so much again for watching i will see you all next time thanks [Music] [Music] foreign
Info
Channel: FinePointCGI
Views: 18,927
Rating: undefined out of 5
Keywords: animation, animation retargeting, unreal engine 4, how to retarget animation in ue4, blender animation addoon, image animation, godot, godot engine, unity animation modular, import animation, how to add animation to character in ue4, blender animation, character animation, replace sprite animation, unity 2d animation package, photo animation, unity 2d animation, how to reuse animation in unity, animation software, photoshop animation, 2d animation software
Id: NBukd3NmK88
Channel Id: undefined
Length: 24min 30sec (1470 seconds)
Published: Fri Aug 05 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.