FP: Animation with Inverse Kinematics modifiers coming to Godot 4!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everyone and welcome to another feature preview of godot 4 today we'll talk about this nifty little addition to good old four it's not a plugin it's part of the the main code base the core code code base and i want to talk a little bit about it because i see so much potential of applications using this or dynamically positioning your skeleton or your your character depending on what you want to do thank you for twisted twig leg he is part of google's summer of code of 2020. he brought and made a lot of changes i'll leave the this pull request and the other pull request that he also worked on and his own project which has some demo things and this one is the main one which was the one actually merged though this one has less information this one will have more check in the description if you want to check all the different things i'll just showcase a little bit of what i found so as you can see here in the this demo scene that i will be building together with no quote by the way i'm making the head of the character follow something i'm also making the hand stretch out to try to to grasp it and this can be done while an animation is being played as you can see here so you're able to merge an animation say of a character running while trying to you know stretch out or something in front of it or maybe you want the character to press a button for example so it needs to while it's animating its idle frame or walking frame depending you can also animate this you just make an animation of him stretching out to somewhere and then you use this method of modifying the bone so that you can define where it actually points to of course some limitation needs to be done so that you don't break immersion as you can see here okay so let's let's build this from scratch i'll just make a new scene here and if i were you just drop into mixamo i got this jumping animation just get anything or just get your own character maybe that you want to try it out and import it to your scene i'll just instantiate here save this into my ik this would be ik two and yeah this is our brand character coming from fbx if i right click and make adaptable children i'll be able to find the skeleton and be able to even see the bones do things with the bones you see there's a lot of customization you can already do here the first thing that i will talk about very fast is there is a little bit of updates in the bone attachment 3d you are able to override a pose i'm not entirely sure if this is finished yet but keep in mind this is all already possible and here's an example say i get the head and i can't move here if i click here over right pause i'm able to move the head to wherever it goes note that if i overwrite both then like it literally overrides the entire animation so maybe something that i want but keep this in mind now to the changes in the skeleton 3d and they are mostly done through resources so you could create the resources here and also through code and edit everything through code or even through animations i'll do it manually just for to give the example but i'll leave it to you to imagine what more can be done this thing is the most important thing new modification stack where you can stack modifications on top of whatever is being done to the bones in the armature we create a new stack i'll even make this bigger so that you can read everything in case you want to try it out too i'll enable because by default everything is disabled and i'll add one modification this one modification will be i'll look at modification there are several we'll look at this one and this one i couldn't make this one work and the other like this one is a generic one that i think you you need to implement by yourself that's what i understood and these two and this one i didn't try but let's see look at is the most easy and simple one even by the developer themselves i'll just make a sphere so i now have a target so to speak to the look at now coming back to the skeleton 3d i can go here and assign the bone that i want to look at i imagine there will be easier ways to do this when this is actually released but for now i need to actually find the this idx from bone attachment 3d at least i found it's the easiest way of doing things go back to here i type 5 it populates the name i'll say my target is this mesh instance 3d and you already see that the head is even though it's totally weird it's following now the the sphere super simple to fix that we can also just change these things and what i found doing it does well for this mesh in specific are these values but maybe your mesh will be a little bit different i can even say looking a little bit upwards and now the ball you can move and it will follow the ball even during an animation so let me put it in repeat you'll see that the animation happens everything but at the same time it's trying to look at the ball you can also use a modification that is built on top of it which is the strength maybe you don't want it to totally follow just try to so you can see if i move here it will move a little bit the the head but not totally i'll make this strength probably 0.7 and you'll see that it now the head won't actually go too far it's more realistic this way except this breaking point next part it will be the other modification i'll stop this for now the other modification can be done on top of this one so what i'll do is save this one save in my ak i say add look maybe okay so now i have this one i'll modify this one to be a stack folder i said i didn't test out this one but this one is just another stack on top of the previous stack and i'll call this stack reach out and part of this stack there will be the previous one which is the head look and i'll add another one which will be the hand reaching out the hand reaching out i found it's good to do in two steps so because of that i'll just create another stack holder and within this one there will be two things happening into here you you can see it already gets a little bit out of hand but of course i can just click on this one and simplify things for my interface and reach out i'll do two things first will be the fabric and then i'll do a look at the fabric will focus on moving the arm forearm and left hand these three towards the ball and the look at will make sure that hand itself is facing how i want to the ball you'll see why that is useful when i finish the first part so let's get the numbers of these three left arm forearm and so on uh left arm is 10 so 10 11 12. i'll say my target will be that ball once again my joints this one will have three bones and you can try out many different lengths and different bones as well i'll say the first one is 10 second one is 11 and third one will be 12. and we're back i noticed that there was probably a bug still lingering you need to go to skeleton and through the skeleton select target notepad if you do it outside like double clicking here and selecting from here it won't work you need to go to skeleton and select but maybe this will get fixed later so now with this you can see that within the modification stack there is a reach out this reach out is a stack once again with head look which is changing the head and hand reach out the hand reach out is currently just focusing on making the hand stretch out to the ball and you'll see what happens if i get close this is totally not what a normal hand would do so to fix this there are many parameters that you can choose and edit one of them is this roll thing so i rolled this first bone over here and now i just want to make sure the hand is properly pointing so i could roll the hand but then the hand will actually be in a weird position once again so this is what i meant now the hand is not actually reaching out to the ball is you see what it does so instead of doing this i'll just make another modification to the bone after this one i'll add another one and this will be once again the lookout lookout will focus on the hand which is 12. i'll make sure to point to the same place and now i can edit how i want it to be so i changed the zed to 60 and now it's already what i want so now you can see it kind of brings the ball to himself even maybe this is an apple and you want to eat or something i don't know and this can all be done dynamically which means if the apple is on the ground you can have an i have a jump animation which is the opposite maybe the apple is above and you're jumping trying to reach the apple now we can do it much more can be done obviously i i'm just messing with the arm same could be done with the spine to make sure the spine is pointing towards and of course this can be also the opposite instead of uh apple could be something that you're throwing away or maybe you're just walking and you want to reach out and now you can also add to the skeleton more bones so that you reach out with the finger and not the entire pile once again shout out to twisted tweak black check his twitter account for some more examples that he talked about in 2d and 3d and you can grab the godot code to test it out coming to the merged pr into checks and you just find what whatever operating system you're using and download in my case it was this one thank you for watching
Info
Channel: Aknakos
Views: 8,463
Rating: undefined out of 5
Keywords: godot 4, feature preview, inverse kinematics
Id: 6EkKXhTSBFY
Channel Id: undefined
Length: 12min 33sec (753 seconds)
Published: Mon Aug 23 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.