Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Issue with Maya Constraints, Need help and Assistance please

Issue with Maya Constraints, Need help and Assistance please

animistar63
Explorer Explorer
3,277 Views
4 Replies
Message 1 of 5

Issue with Maya Constraints, Need help and Assistance please

animistar63
Explorer
Explorer

Hi Friends,

 

I'm working on a Animation shot where the Biped Character (Lynk) Jumps on the IRex Character and grabs two of its orns tight. Irex tries to swing its head fast to throw Lynk down but Lynk manages to grab tight..etc like wise the scene progresses forward.

 

My confusion and doubt here is:

I used Parent constraint by Setting up a cluster on the Irex's Horns and Parent Constraining the Lynk's Hand control to the clusters. I animated the constraint weights 0 and 1. When the weight is set to 1, the character is garbing fine but unfortunately When the weight is at 0 Lynk's hand contol is unable to be transformed or rotates. Its getting locked. I'm unable to setup keyframes. Previously before this sequence I've other keyframes setup in the hand controls ( Before the need of parent constraint) its not disturbed but again I cant move the hand control in anyway. its like locked..!!

 

I also tried adding in animation layers over the top of the base animation Layer that has all keys. Still in the new Animation Layer I'm unable to Move the hand control and pose differently. Its again locked.

 

If I'm doin it wrong can someone please help out showing the best possible way to fix this error.

 

I'm attaching a ref pic of what I mean here. Can someone please help out here. I'm in the middle of a animation that has to be completed for my showreel. 

0 Likes
Accepted solutions (1)
3,278 Views
4 Replies
Replies (4)
Message 2 of 5

Kahylan
Advisor
Advisor
Accepted solution

Hi!

 

Normally you don't want to constrain a control that you animate as well. Delete the constrain on the control and set the controls translate and rotate values to 0, create a group that has the same position as your control, group it under the parent of the control, then parent the control to it. Constrain the group to the horn and animate the constrain the same as you did before. That should fix your problem.

 

I hope that helps!

Message 3 of 5

animistar63
Explorer
Explorer

Hi Kahylan,

Thank you soo much for your time. I did the grouping. I Parented the Lynks Hand Control to the Newley created Group as you said and Parent constrained to the horn. The problem I'm facing now is, I have previously animated the hand control and the hand control has keys in it until Lynk catches the horn. Now when I parent the control to the new Group Hand Control, I'm getting the original hand control stuck to the parent and the Previously set up keys dont work. I'm working on IK mode FYI. Is there a way to fix this.?

 

Also If I group and Parent this goes out of the Global control. Should I parent this new group with the Global Control.?

0 Likes
Message 4 of 5

Kahylan
Advisor
Advisor

Yes! Before you parent the control to the group, parent the group to what the same parent the control is in, so the original rig hierarchy doesn't change.

Also it would probably be even better, if instead of constraining the group to the horn, you constrain the group to a locator at the same position and then move the locator to the horn and parent it under it.

 

It's all a bit hard to explain via text. So I'll give you the script I normally use to do this.

Just select your horn cluster and then your hand ctrl and run this script in a python tab in your script editor.

 

#select parent first then child

import maya.cmds as mc

def constCTRLtoObj(parentObj = None, childObj = None ):
    """ creates animation save constraint from parent (selected first or kwarg parentObj) to child (selected second or kwarg childObj)"""
    
    #defining parent and child 
    sel = mc.ls(selection = True) or [parentObj,childObj]
    
    #getting parent above child
    childParent = mc.listRelatives(sel[1], parent = True)[0]
    
    #getting position matrices
    cpma = mc.xform(childParent, m = True, q = True, ws = True)
    pma = mc.xform(sel[0], m = True, q = True, ws = True)
    
    #creating separation objects
    grp = mc.group(name = '{0}_const_GRP'.format(sel[1]), em = True)
    loc = mc.spaceLocator(name = '{0}_offset_LOC'.format(sel[1]))
    
    #moving into position for initial constraint
    mc.xform(grp, m = cpma, ws = True)
    mc.xform(loc[0], m = cpma, ws = True)
    
    #parent child object to separation grp
    mc.parent(grp, childParent)
    mc.parent(sel[1], grp)
    
    #constraining to separation locator
    mc.parentConstraint(loc[0], grp, mo = False)
    
    #moving and parenting Locator
    mc.xform(loc[0], m = pma, ws = True)
    mc.parent(loc[0],sel[0])
    
constCTRLtoObj()

 

I hope this helps!

0 Likes
Message 5 of 5

animistar63
Explorer
Explorer

Awesome. I now understand the Grouping and Parenting you were taking about. The script works fine, I think I've followed u're instructions before you shared the script and it worked fine as well. The only issue I'm facing now is the Hand control pops out to a different location in the Keframes area ( The section that is already keyframed) The constraints work fine before and after the script, no issues in that but the only thing now is Hand control pop up like in the attached image.

 

I even tried to re-keyframe few keys individually in the previously keyframed section of the animation ( The part before constraining to the horn) this works fine there's no pop up. Do I have to redo the whole animation sequence for the Hand control again in the keyframed section.? All other controls work fine.

 

Now After Constraining its a total new part so that part has no issues.

 

( In Pic one, The control with the Transform Gizmo is the Hand control that's popped out)

0 Likes