View Full Version : Attach/Detach with Maya???
Bob Marley
01-09-2008, 04:34 AM
Hey, got another question, whats the best way to go with constraining object, but being able to grab stuff and than let it go??? If possible without a script, but if theirs a cool script why not.
The way I do it so far is pretty dodgy, I create a group above the hand controller, attach it to the object, than to let go I have so swap from Ik to FK, I really rather doing it another way, when you work in a company you have all this nice script for it, but out of the company, I feel so useless : )
Best way to answer question is to actualy ask them, just thought of a different technic, make the object desapear, and create another one at the same spot and keep going : ), but still I want to hear other ideas : )
brianBurke
01-09-2008, 01:00 PM
This one's easy Bob. You don't need any scripts or fanciness, as Maya does most of the setup for you automatically. The first step (optional but highly recommended) is to take your two objects (the hand and whatever you're picking up) and create a locator for each of them. Parent constrain the pickup object to the first locator, and parent constrain the second locator to the hand.
123590
I'd recommend using locators to for all this animating stuff. You'll save yourself a lot of time in the end because your rigs and scene geometry will stay nice and clean with no excess nodes.
Also as a general rule, never parent objects, only parent constrain them. Parenting creates a wacked out selection hierarchy and can lead to transformation glitches.
Then, you just need to do your usual keyframe animation of the arm coming in to pick up the object. When everything is as it should be, key the position of the pick up object's locator at the frame before it's supposed to be attached to the hand. Then parent constrain the object locator to the hand locator. This will create the super awesome pairBlendNode! This will show up as BlendParent1 in the transformNode of the pick up object's locator.
123591
If you play back your animation at that point, you'll see that the pick up object stays with the hand the entire time. This is an easy fix. All you need to do is key the BlendParent1 attribute to be 0 the frame before the pickup, and 1 on the frames where the hand needs to be attatched. To let go, all you have to do is keyframe the let go object's locator, and then key the BlendParent1 attribute from 1 to 0.
123592
This might seem complicated at first, but you'll get comfortable with it quickly and it'll be second nature.
Good luck!
Bob Marley
01-09-2008, 09:56 PM
Wow, sweet man, I ll try that tonight when i come back from work, thanks.
vBulletin® v3.7.4, Copyright ©2000-2013, Jelsoft Enterprises Ltd.