Driving Morph Targets from Control Rig in Unreal Engine

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
let's take a look how we can drive morph targets from control rig controls in Unreal Engine 5.4 this is something that I've recently figured out and I thought hey this is awesome I'll go and let you know how I did it and also my future sell that I don't forget so this requires a scal mesh that already has more of targets that you can drive in the first place so I've got my lovely assistant here Miss Victoria 9 to help me out and on the right hand side I've got some vs and on the left hand side I've got some a nice I can totally puppet Herer Isn't that cool on the left hand side I've got some Expressions here like you know uh happy I guess and um something like that's I'm not too happy about that and you know very very happy to see you all so let's let's see how we can do that let's create a new control rig for my girl in the first place so we do that going onto the skeletal mesh and then we right click and then we say create control rig that's not a modular control rig that would be something else we're going to just make a small control rig that we can go and layer on top of existing rig so you can add this logic into an existing control rig if you like but that's going to often turn a control rig a single file into a huge monster and with 5.4 we have this option to animate with layered control rig so you don't have to cram everything into one control rig you can have multiple control rigs that each function has a small piece of the puzzle and then just layer them on top of one another this is one of those things that I'm going to do so control rig and that gives me this here so I'm going to go and rename that into maybe v9 expression test just so that we know what that is save double click to open it and then we get something like this so this if there's something in here already which sometimes there might be if you're using the D to Unreal bridge then I would recommend you select everything in the control graph here and just delete everything and then just bring back the forwards control node here because that's the one we do need and then we'll go over to the rck hierarchy here and close everything down we don't want to attach anything to existing bones we're going to make a new one so make sure you don't select anything just click into here right click and say new control and that is going to be one for let's call it smile the first thing I want to do is change what this control is supposed to do so by selecting it I can see that on the right hand side here on the details it's value type is set to Oiler transform or uler transform Oiler I think it's called Oiler and we want change that because this is meant to be a bone control thing or that's what it defaults to we're going to go and change that to a float value so that means it changes to a little draggable slider thing and if you have a look under these values here you can select multiple by going current control Min and Max I'm just going to go and hold these select these three you can see that as I drag this into the X Direction I get a value change and this is what I'm going to exploit to drive my morph Target so that is how we get the value out let's go and quickly correct the position I don't want that to be in the bottom here so I'm going to go and choose to my offset here on the Transformer offset I want to make the location a little bit higher like 1 maybe 160 something like that so in her head height because it's a control relating to her head and also it's a bit too far in the head so I don't want to do that either so let's go and move that over 30 20 maybe on the X and also it's a bit too long so I want to scale this down so that will be on the offset scale here I'm going to go and make a uniform scale and maybe make that sort of I don't know 20% of this so 0 2 and that will scale the whole thing down including my control shape but we can go and scale that up later so that is what it looks like now and that sort of performs quite well for what I'm trying to do here uh on the bottom here control shape you can change that from the default sort of solid ball to something like say it's solid arrow that is now pointing in the wrong direction so let's make that a little bigger maybe four times as big and then also rotate that around the X by 90° and we have something like this so that's a nice little you know visual control here might even go and bring that sort of to 10 or maybe 15 there we go a little bit closer we can zoom in nicely so that's our control set up so now Comes The Mystery of how do we drive this thing so that happens in the control graph here in the Rick VM graph and you think we're going to go and grab this out and put it into here somehow but that is not how it works we're going to go and create a node manually by right clicking and saying get control float so that gives us this and that then has the float value that we want to exploit we have to go and select our control manually or if you're doing this in code then you can also provide a named variable here I'm going to go and change this to well new control that wasn't that wasn't great let me go and compile this then it knows that there is in fact a smile control here perfect so that's what I want to take out so the float value for my smile control and I want to set this as a curve value so I'll say set curve value oops curve as we are familiar from these things in animation sequences if you want to animate these things directly then you would animate curves technically and that is what we do here the curve itself is the morph Target you want to drive so I'm going to go and choose smile these are all my morph targets here smile and then we hook that up and that is essentially all we need to do now when we drive this control um drive this control then we see oh beautiful this is um this is great this is exactly the result I wanted to see so it kind of works but it doesn't work as expected and the reason for that is that this float value gives me a value value between 0 and 100 and then I think after five if you look closely at the current value here after five there's no exaggeration of the morph anymore so after five it just remains at that position so I don't want it to be that high I want it to be between one and between zero and one basically or something along those lines so what I can do is there's multiple ways of doing it like so often in Unreal Engine let me all select this to get rid of that and just divide the value that comes out of here by 100 and then we have the number we're looking for so this now drives my morph slider much much nicer this is more kind of what I had expected this is what I want here so perfect she's she can smile and I can drive it with a control this is fantastic so if we wanted to use this though in the sequen we also have to provide a backward solve for this and that would do exactly the opposite and this is just we we don't have to hook it up necessarily but it has to have some kind of backward s functionality so that it appears in sequence later so let me go and um show you how I would do that so you could if you wanted to add other things to this you would just go and add this you copy these nodes and just uh go hook these up and change these values appropriately until you have uh as many morph targets hooked up as you like so the backwards solve is the opposite of what we have here so we would go and say set float value or SL set control float and we're going to hook that up and we're going to set the smile control and we're going to go and set that from essentially like a get curve value so get curve value from which we say what curve are we getting we're getting the smile curve and then we're going to hook that up to uh here almost I've forgotten that we divided earlier so we need to now multiply of course by 100 and then we hook that up to here so that is our backward solve done and you'd have to do that for every control you'd want to drive let me show you how we would use this inside a sequencer node here if I go and uh go over here do I have something like this already in here do I I do oh perfect okay good so I'll go and uh and recreate this from scratch in a moment but for now I've got a small animation here that has these two control rigs here I've got one for express and one for vs and if I go and scroll through this you can see that the sliders are all moving and they're all animated independently and the way we would do that in 5.4 which is kind of cool isn't it now you can do that plus a regular control rig for joint controls and you just go and add all of them up and then just keep animating in bits and pieces so very very nice I have to say very cool so let me go and get Victoria out of the sequence here completely and start uh from scratch with this um set up so with the figure I would go and add her to the sequencer first of all and then I can go and add a control rig here so asset based control rig oh I also want to do layout here asset based control rig so I'm going to go and use the vs first that will provide this control rig and now I can go and animate that so vs maybe just go and put zero here and then at at frame 30 you'll have uh any of these controls that you find a good match so maybe maybe whoops not not quite so much oh yeah it's a slight inconsistency with animating in sequencer versus what we've seen here on the control R in the control R VM panel whatever it's called where here I could literally have a sliding control value the sequencer doesn't allow you to do that for some reason it only switches these to full whack or to nothing there's nothing you can put in between I don't really know why that is so once animated and this one's obviously got a got a higher than it should have value you can go and change this uh number here to something less so I want to maybe just animate that to here and then it does it but I don't know why it only goes to one and to zero and not to anything or to full to 100% And to zero I don't know why that um why that happens I I don't know but that's just how the cookie crumbles so anyway these are the seams here on that side and if I wanted to have something else like forward ik rig or Ground Control rig or something else that drives other aspects of the figure I'll go back here to the figure and now I can add another control rig this we couldn't do this in 5.3 once you have one control rig on there this this option isn't there so now in 5.4 we can go control rig and then say Expressions here Expressions goes on the other side and now I've got a different control rig that I can also animate on top of that so maybe I can at this point here let's say that is zero and then maybe a few frames later I want that to I want her to something do something like a smile perhaps like or you know be unhappy that's nice so now we have unhappiness plus the seams and then we can go let's say this is zero here again and I can also overlay them so I can have maybe this that's maybe a little bit too crazy maybe this here that's just as crazy but that'll be fine and then I can go and animate other controls on top of that so these are the seams here and then I have to just go and make that a little bit lower and then I can go and animate all these things on top of one another and I'm thinking that's a really really cool feature so now you know how to do that and as I said it works with anything that has a morph Target so not just Das figures of course but anything that has morph Target so that is how you do that if you do have any questions don't ask me because I've only just found out about this but if you have any more info about this or any more tips and tricks do let me know as I will if I figure out more stuff I will of course let you know how to do it thank you so much for watching I'll see you next time take care bye-bye
Info
Channel: The WP Guru
Views: 779
Rating: undefined out of 5
Keywords:
Id: zk3CS-9ID2U
Channel Id: undefined
Length: 12min 4sec (724 seconds)
Published: Mon May 06 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.