How to Make Characters Grab Objects - Parenting Constraints

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
what's up everyone welcome back to how to become an animator I'm so waiting in today's video we are going to be talking about parent constraints for animation basically the issue of if you need your character to pick something up to then be able to release it for someone else build pick it up there are a lot of different ways to do this and there's only a few correct ones we've all struggled with this at one point or another trying to figure out how best to stick something to a character's hand or their feet or their body or whatever so in this tutorial I want to show you some of those different techniques and why some of them are going to be better than others for your type of shot now if you're in a crunching you just click this video to find out the best method or your revisiting this video later and you've already watched all this the time code for the final best solution for parent constraints is here now if you haven't seen this whole video before I highly recommend just watching the whole video I did not make it long to bore you I promise it's useful information you'll learn a lot from it and you'll understand what you're doing a lot better so that you don't have to be googling these answers so much you'll just know what to do I pretty much everything about to cover is going to apply to any 3d application that you may be using I personally will be using Maya and the entire Maya project file that I'm using here that I've animated created all this stuff is available to you guys on patreon so if you want these project files and you just want to use them learn from them do the exercises or just animate with them because they are complete rigs at this point feel free to head over to the patreon link here and you get access to this as well as a ton of other content so check that out if you're interested now with all that covered let's jump into Maya now in my last video I showed you guys how to create these robotic arms just using parenting super super easy basic rigging without any knowledge of rigging you can build these kinds of characters so some things I want to highlight for you today there are several different methods that you can use to try and have a character pick something up now most people think of this process you have two options in mind either parenting or parenting constraints now if we examine these robots here on the Left this is an example of just regular parenting the benefit to this is that the box can move with the arm and everything looks pretty good the problem as you can see there is that the box cannot be disconnected from the initial robot relationship so bottom line you can only connect it to one thing and it will always forever be connected to that one thing now as you watch all these different examples you may think to yourself well that option may not be the best solution but it's probably fine for what I needed to do you want to allow yourself the opportunity for your ideas to grow and change that's very much the same when you're setting up these types of relationships if you're just doing parenting or parent constraints if you're doing it a certain way because that's probably fine what happens if your idea changes in the future and you've already done some work you probably want to be set up in a way that allows you to be more apt able to do different things you're not fighting against whatever it is you've created or going back deleting work and remaking it so bottom line is if you see a method here that's like oh that's probably good enough I recommend that you use the more advanced way I'm gonna show you how to do it so don't worry about you know it'd be more complicated I'll teach you just know that that's going to allow you more creative freedom if your idea changes and it's gonna make it easier on you if you decide to do something a little bit more complex and whatever you've built allows you to do it more easily so here we have is an example of a parenting relationship there's no constraint it's just parenting now it works really well because you can see that the first robot arm is able to grab it and move around and the box and the arm can both be animated separately is what I'm trying to say but you cannot turn off the relationship between these two objects that first robot can never let go of it and I'll show you some examples of that in a second so now we come over here to what was set up with a parent constraint and if you see here it's the same exact animation but this time the box is able to detach from the first arm and move over to the second arm now even if you don't have two characters or two hands or whatever if the point here is that you can have something grab something and release it and then it can go have another relationship elsewhere you cannot do that with a parenting relationship and I'd like to show you how that all works so here I'm going to demonstrate for you two different primary methods of doing this parenting and parenting strains now within parent constraints there's three different ways to do it each one more correct than the last and I'm going to show you very quickly and very simply how he foam works and how it can be improved upon until we get to the final best solution that I'll show you how to do for all of your animations so what I'm gonna do is take a cube I'm going to stretch that cube out and basically make like a seesaw teeter-totter type of thing and I'll take a sphere and I'll put that right on top there I'm going to want this thing to move up in the air and throw the ball off of it so what I'm gonna do is make a few copies so that we can do this a few different ways I'm gonna grab this I'm gonna duplicate it move it over and you shift D a few times to just mass copy it with transform super quick and easy I'm gonna grab all these blocks of wood I'm gonna hit s to key them I'm gonna let them just sit there for ten frames and then over five frames I'm gonna have them all move up they're gonna sit there for five frames and they're kind of coming down in five frames back to zero and I'll just keep them they move up they go down the ball does nothing yet but that's the whole point of what we're about to do so first comes our most basic of all relationships just regular parenting them as a child then parent and say Pete or go to edit to parent so now it's going to link the ball to the board and let's just say that on this frame the ball akia here it's going to go flying off this direction there you go up and flies away so far so good however as soon as the board moves you'll notice that it's still controlling the ball one of the benefits of this type of relationship is that the parent and the child can both be animated to do whatever you want the problem with it is that the child will always have to do whatever the parent does if you translate it if you rotate it if you scale it it doesn't matter it will always obey no matter what so it's not the best option for something like a ball to be thrown from a hand because if someone throws something and then they move their hand the ball is gonna get pulled with it for this reason regular parenting is out next is a version of parenting that I used to use when I was a student to try and get around that problem because I didn't know how to do parent constraints either and I just needed to find a quick solution to just do something but I didn't know how to do it properly I'm gonna show you what I used to do in case you do the same but do not do this as correct either because it's not I'm gonna do the same setup I'm gonna say child parent P the board goes up but I used to do is I would go to the frame where the ball was going to then detach where the object was no longer supposed to be controlled by the parent object and what I used to do was take the child object duplicate it and right now you'll see that if I move it it's actually still tied to the whole thing so what I would do is after duplicating it I would go to edit unparent or shift P and so now it's no longer attached to the whole system I would go to one frame before I duplicated the object into existence and I would go to visibility and turn visibility off so it didn't seem to exist yet but I would do with the original ball is I would go to the frame right before I did the duplication I would key his ability on and then on the frame where the other one is appearing I would turn off the original one so what happens is it seems like the ball is just sitting there and then you have a new ball which is the duplicated ball that I would then go and animate now you can see here that it looks like it works you now have a separate ball object but this is not the correct solution do not do what I used to do there are two primary reasons why this is not good the first is that if you do any renders which not everyone does but if you do render the motion blur will break this illusion if you have one object come in and go away and then another one appear and the motion blur is not gonna sync up the second and more important thing is that if at any point you make any change to your animation which let's be real you're going to make some kind of change and it is a nightmare let's just say the planks can go a little bit higher since you a little bit farther right there you can see the problem we now have to move the ball and try to match exactly the same spot I can't tell you how much time I spent in an orthographic view trying to line up the pixels to make it exact because if you don't have exact the thing will teleport so imagine someone trying to grab a cuff or something and the moment they grab the mug you know slightly in a different place and just teleport a little bit it's a hassle if you change it again you have to do it again it's just a mess so it's a method that looks like it works but it's way more of a headache than it's worth trust me believe me like I've been there I've done it a ton of times don't do that method delete so you've seen parenting now we're here to talk about parent constraints so let's get into that starts taking so long but it's going to be useful as we move forward and you can see the differences so it's gonna do it pair of constraints are set up in the reverse order than parenting so if I want to set up a parent constraint at its most basic level between these two objects I'm going to go instead of child parent it's now driver driven this is the driver and this is the driven think of it like a driver in a car you know this is who's in charge this is who must obey so you are in charge of you that's the order of clicking make sure you're in the animation menu set because we're going to go up to constrain create parent constraint click the little option box you can check a few to different options here this box is important because it makes sure that these things stay in their current location and then you can decide whether you're doing translation and rotation doesn't matter we're just gonna say yes so I could have just gone constraint parent and we would have been good so if we move forward you can see it's now attached so far so good just like parenting now what happens if we move up to the frame and it is 15 nothing changes with the board but if I click on the ball look over in the channel box you now can see there's some blue tags on all these translates and rotates so I move around here you can see that the ball is actually receiving the inputs the location from the motion of the plank as for blooming is getting an input now if I set a key it turned something blue to green that breaks the relationship ultimately what you have is the ball was listening to the plank and then you told the ball to do something else it gets a little confused of who to listen to so it just goes with you and it breaks this constraint now there's one thing to know here is that when I do set the key it creates something called blend parent one now for those of you in the comments who are about to jump on me and say like well you can do it like there's a blend parent thing like yes there are ways to make this work however it still does not give you all the functionality that you should have because to reattach it's the same object there's a lot of reasons why this method is not the right method to use especially if you're just starting out so for many reasons this is not the correct choice now we're almost there only one more to show you before we get to the final solution but I promise it's gonna be worth it for you to see this now this one that I'm about to show you is actually the method that I used for this setup here that you've seen earlier which is Vox moving from one arm to the other so this is not a bad method it's just not the perfect method so here in this next one here's what we do if I grab this ball you can see that the translation manipulation like this whole interface here lives inside the ball every object has it but I'm going to do is I'm going to take this sphere and I'm gonna just rename it let's call this s ball and I'll call this thing test board so these are our test ball test board I'm going to say control G or edit group now if I hit the translation key you'll see that the manipulator is now over here I don't want that so I'm going to go to modify center pivot and that puts it back in the middle where it belongs now what I've done in case you like what just happened and you'll see the name is also different I'm gonna call this test ball because you'll see if I go to test ball group over in my outliner which by the way is this button which I've had active for a little bit test ball group inside of it is where test ball lives so if I just click here it actually grabs test ball but now on the outside a test ball group so you may be asking what was the whole point like why would you do that let me show you we're going to do the driver and driven thing if I say driver and then I'm going to instead of shift-clicking the ball I'm going to control click the test ball group so it looks like the ball selected but I'm actually going test board driver test ball group driven I'm going to say constrain parent constraint you can see that it actually creates a parent constraint within the group and you'll see people do this with locators as well I prefer to use a group because I think it just makes it a little bit simpler and so what happens if we move forward you'll see that it moves up and moves down just like we would expect but if I go up here and say on this frame I want to try animating the ball this has never worked until now so if I hit set a key and we move forward a few frames and we move up in this direction watch this whoosh there it goes now it's still having an issue right like it's still controlled like I can't do anything with it here here's the beauty of this one first of all I set some keys and it didn't break the relationship like in the last one so so far that's better but how do we turn off this relationship I'm going to do is I'm gonna go to the frame right before this is gonna happen so frame 15 is the frame that I keyed the ball and we click on the parent constraint I guys can click on the group because that's where the constraint lives you can see there on the test ball group there are the blue things I showed you or the inputs are coming in this has balls not affected by the constraint it's the that the ball lives in that is affected by it so I neither click on test ball group and see over here there's some stuff or I can go to the parent constraint itself and you'll see over in the channel box OC test board w0 currently it's set to 1:1 means on 0 means off so before I've taken control of all the test board constraint is on key that because that's good so right-click key we key that as being an active relationship if we go to frame 15 as of frame 15 one frame later I'm going to change the test board constraint to 0 off and I'm going to key that now here's the problem the ball jumps back to its original rest position and then animates which is no good now what most people do in this situation is they use locators and they you know they have it move the one spot and then they have it constrained to another locator and then they go to another locator and a lot of people have a workflow to work around the fact that it just jumps back to wherever it wants to go I have a solution that took me years to just realize is one stupid little check box that's just sitting there if you deal with this problem is gonna blow your mind check this out I'm gonna click on the parent constraint stead of being the channel box I'm gonna hit control a and I'm gonna go to the attribute editor now you could be doing this instead you can do all the same stuff we've been doing from this it's just a different interface however if I come over to the edge of your editor you'll see if I have the parent constraint itself selected there's a constraint attributes drop-down click on it and you'll see a little check box for some reason on by default that says enable rest position turn that sucker off now scrub through your animation it does not jump back to its rest position because you've turned off the rest position it just turns off the constraint wherever it may be sitting at that moment and then it takes your animation data and goes from there so that's great because now for the first time we have total control over an object that's also intuitive and easy because I can grab this box and I can move it you know the ball still has its animation now the only reason why this is not the correct method and why we're not stopping here is because what happens if this is somebody's right hand and they're grabbing something and they're throwing it in the air and they have to grab it in the same hand again this is the exact method that I use when I created these robot arms which proves that you can have it go from one hand to the other what happens if it needs to go to the same hand so let's just do this real quick I take the ball goes up and down and now I want it to reconstruct rain apparent constraint that operation just turns it back on it doesn't create a new separate constraint it just turns on the old constraint but in a weird way so now you can see that is actually broken from the start it's now having issues and it's you know maybe it's staying here now but it's broken in the beginning okay we are now with the final method this is the solution that you've all been waiting for this is the culmination of everything you've learned so far this is the correct way to set up a parent constraint to be able to animate the character picking out putting down transferring hand putting it back in the same hand whatever you need to do you can do it with this method so here's what we do we have the board it's animated already so that's fine we're going to take this ball I'm going to rename it and just say all example I'm going to take this board and I'm going to call this board example I'm going to take the ball and just as we did in the last one I'm going to go to edit group so I'm going to group it within itself like we did before I'm gonna call this small example group I'm also gonna make sure that because the transformation point moves over there I don't want that so I'm just gonna go mad if I center pivot so let it's in that correct place I'm going to do something different all the problems we've had with the previous parent constraints have been one of two things either we're constraining something that doesn't allow us to have flexibility to still animate that thing which is basically why we introduced the group or constraints can only be turned on and off for an object and it always refers to the same location on the object that you made the initial constraint so you can't have it start here and then move over here and reckon strain to the same object it's an issue of one object constraining to another object so here's what we do to get around that we're going to create new objects to handle and manage those constraints better by combining some different techniques so I'm going to do is I'm going to create a locator right here great locator I'm gonna hit W I'm going to move this thing out if you've never messed with a locator before all it is is this little null object it's a little just marker it's a three space marker it actually doesn't do anything it's just there for you to be able to manipulate however you choose so here's how I recommend setting up your constraint take the locator take it to wherever it is that you want to create the constraint which is here now I think of the locator as a target it's the location in 3d space where you want this relationship to start I'm going to grab this locator I'm gonna rename it I'm going to say board location a because it is the location on the board where we want this to start and I might do more than one so a b c the idea first things first let's use some of the different techniques we've learned i'm going to grab the locator as a child and say you are the child of the parent board P so now as the board the locator moves with so if I come to board example and I twirl that down you can see in the outliner here we have this locator which is board location a and we have while example group that's what I want to do I want to say board location a the locator driver ctrl-click ball example group so driver driven locator group then way to say constrain great parent constraint so now the ball group is constrained to the locator position and the locator position is driven by the board because it's parented so if we move forward the ball moves up so far so good get to this frame I'm going to take the ball on this frame I'm going to set a key on the ball because that's where I want to start animating it and maybe five frames later off it goes but remember we stuff to turn it off so we're gonna do I'm gonna go to frame 15 that's where everything's starting I'm gonna click on the parent constraint which you can see here is two board location which is that locator on frame 15 I'm going to have that on and on frame 16 where the ball starts to move I'm gonna say zero key that to off now again it jumps down to another location we don't like that so the hell Mary of those of you who use this method and have to use a bunch of locators to try and transfer ownership no more of that because again I just go to control a I go to the attribute editor and with the parent constraint selected I go to the constraint attributes tab and I disable enable rest position by unchecking that the ball no longer snaps to a weird old location it just continues on as normal then the ball it's the board now this is the moment of truth we've not been able to successfully stick this thing back to the board this entire time so we're gonna do is we're going to create one final locator let's scale it up so we can see it and move it up here move it onto the board or location beat so I'm going to do take that shift-click the board P for parents so now if you look in the outliner you have a board example which has two children or location a or location B or location B is the new one we've just created I can make a little smaller so it matches now the same thing driver or location B control click ball example group I'm going to go to constrain parent and make sure that we look again at the parent constraint we need to key this thing so I'm gonna say on this frame on whatever frame was before it go ahead and turn that off key it so it off turns on and again one more thing we're just gonna make sure we say rest position off enough so you can take all these these locators once you've you finished with them and you just turn off the visibility so that they aren't in your way grab our ball what's over here it is constrained to that board it lets go it drops the ball and now did it constrain properly to this board let's find out yes did look at that you can move it down and now finally we have the ball attached properly letting go grabbing letting go grabbing and holding on this is the full final method to be able to properly constrain something to have whatever combinations you want so that you can have things reattach and attach to different objects bla bla bla now is this complex maybe maybe it looked really complicated and I've like freaked you out but like don't sweat it you will get there it just takes a little bit of time to practice with this and get used to it now if you want to get used to this stuff don't forget like if you don't want to set all this up and you want to like play with it I have the project files for you guys to available on patreon so check those out if you want to just download the files I have created here so that is the perfect final setup there are obviously tons of different ways that you could be doing this from parenting parent constraints and different forms of parent constraints you can see the different pros and cons of different uses the more basic you are the more limited you are and sometimes you can do some really great work like as you see here this first robot on the left was done only using parenting the most simple method of all and there's nothing wrong with it as long as that's all you needed to do but if you need things to start moving from one object to the other or to be able to go back to the original object and you need to give yourself that flexibility by building a more complex setup so hopefully that was helpful I know that was a lot of information and it took a while to get through but that's like the whole thing the comprehensive tutorial that hopefully now if you watch this once or twice you should understand exactly how parenting and parent constraints differ how they work how to set them up in different ways there's more to this this is the basic setup and the complex part of it because it's understanding how it really truly technically works but if you're going to be using a two-handed swords or really heavy objects and like who's in charge of what we'll get to that in a future video but for now hopefully this is enough remember that if you want to download the project files to this as well as a ton of other access q a's live demos of software technical questions answered real reviews and critiques you want to check any of that type of stuff out check out the patreon here's the link it's all optional but if you want to check that stuff out there's a video on the page and explains everything we have going on there anyways thank you guys so much for watching hopefully this was helpful and if you know anyone else who could benefit from this information or anyone who's working on a shot with constraints and parenting and if they're having a hard time please share this video with them so that everybody can understand all the different ways to do it and if you don't wanna miss out on more tutorials more content like this don't forget to check out the channel and subscribe down below and if you don't want to miss any uploads in the future don't forget take the little bell that way you do actually tells you when I upload a new video but anyways thanks again for watching and for those of you who are going to be voting on the next and over to patreon so you can vote for the next upcoming videos and I will see you guys in the next video
Info
Channel: Sir Wade Neistadt
Views: 65,588
Rating: undefined out of 5
Keywords: parenting constraints tutorial, how to connect character and object, make character pick up, make 3d character grab, parenting tutorial, maya parenting constraint, how to do maya parenting constraint, how to use parenting constraints, how to use constraints maya, how to constrain in maya, constraint tutorial maya, animation mentor, maya tutorial 2018, animation tutorial, animation tutorial maya, parenting vs constraint, 3d connect objects, maya constraint tutorial, constraints
Id: U8JXO39aAqY
Channel Id: undefined
Length: 19min 59sec (1199 seconds)
Published: Wed Jun 13 2018
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.