Community
Maya Animation and Rigging
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya animation topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

keying a constrained control will break the connection

23 REPLIES 23
SOLVED
Reply
Message 1 of 24
gimble
3838 Views, 23 Replies

keying a constrained control will break the connection

Hello,

 

as the title suggests this is the problem I am having. Is there a way to NOT break the connection on a constrained object in Maya? Seems like a simple thing but I can't figure it out. I bake things a lot in animation, and this always breaks my connections.

 

Also if there is a way to do this, why is this not the default behaviour in Maya? If an animator spends time setting up constrained objects for his animation to work correctly, why would I want them to break by setting a key on the control that is constrained. Seems dumb. 

 

Thanks,

 

Craig.

23 REPLIES 23
Message 2 of 24
mcw0
in reply to: gimble

Not quite sure I'm understanding what's happening.  For example, let's say you have a cube constrained to follow a locator.  Are you saying that if you keyframe the locator, the connections to the cube are broken?

Message 3 of 24
hamsterHamster
in reply to: gimble

Yes, that is true - once you bake animation, the connections to constraints get broken.

My solution was to reconnect constraints. You can try the script, see if it helps, leave your vote for the idea.

I have somewhat ugraded that script, however it still has one problem that I haven't figured out how to solve yet, and I have no time for that at the moment. Let me know if you are still in need of solving things like that in a week or so.


,,,_°(O__O)°_,,,
Maya2019.1 @ Windows10 & GeForce GTX1080Ti

If the post was helpful, click the
 ACCEPT SOLUTION  button, so others might find it much more easily.

Message 4 of 24
mcw0
in reply to: gimble

Based on your comment about baking animation.  And on hamster's reply.  You are saying the constraint connections get broken when baking.  There's an easy way around this.  Have you noticed that if you set a keyframe on a constrained node that your connected channels become green and there's a new "blend" attribute?  The blend attribute allows you to blend between keyframes or constraint.  If what you want is to retain the constraint while having keyframes, then this is your option.  Write a script that advances along your timeline and sets keyframes.  Essentially baking the animation.  But by doing it yourself and not using the bake keys function, you retain the constraint connections through the blendWeighted node.

Message 5 of 24
gimble
in reply to: mcw0

Let's say you have a cube and a sphere. You want the cube to follow the sphere. You first select the sphere, shift select the cube and apply a parent constraint. The cube now follows the sphere. If you set a key now on the cube (in Maya 2020), you will break their connection and the cube will no longer follow the sphere. This is what bothers me. Any solution to this? And a solution is not to make another parent constraint. Thanks
Message 6 of 24
gimble
in reply to: mcw0

Yeah that's not really a solution though. I'm sure there's a tick box somewhere in the setting to stop constraints breaking. Autodesk are you listening???

Message 7 of 24
hamsterHamster
in reply to: gimble

Did you check the script in my link?


,,,_°(O__O)°_,,,
Maya2019.1 @ Windows10 & GeForce GTX1080Ti

If the post was helpful, click the
 ACCEPT SOLUTION  button, so others might find it much more easily.

Message 8 of 24
mcw0
in reply to: gimble

In the example you described, once you key the cube, you will notice a new "BlendParent" attribute in the channelBox.  Connect the parentConstraint's weight attribute to this and you can have your constraint affecting the cube any time you want.  The trick is to have the constraint weight and the blendParent in sync.

Message 9 of 24
mspeer
in reply to: gimble

Hi!

 

I can't reproduce here anything like breaking connections.

@gimble provided a simple example with a cube and a sphere and this does not break any connections.

Please check the "Blend Parent 1" attribute that is added to the cube, this controls the blending between the keyframes and the constraint.

My recommendation would be to

a) only add keys to attributes that are not controlled by the constraint

b) use the Blend Parent attribute to control the influence of the constraint and keys.

c) use Animation Layers to add additional keys.

...

 

Please keep in mind that baking does "freeze" a certain animation, so this will bake the current values to keys and will  remove some control you have on the animation, but this is intended and what baking is usually used for.

Message 10 of 24
gimble
in reply to: gimble

Please watch my video, I think it's easier to understand. 

 

Thanks!

Message 11 of 24
mcw0
in reply to: gimble

This raises the question of why one would be keying a constrained object if one didn't want to transition away from the constraint.  If you're just setting keyframes willynilly, then that's the user's problem.  Set keyframes to transition off of a constraint.  The blend attribute is exactly that, blending from constraint to keys.  I agree that the default of "0" is a poor choice.  But it's an attribute that needs to be keyed anyway so no big deal.

Message 12 of 24
mspeer
in reply to: gimble

Hi!

Thanks for the video.

 

No connection is broken as your video proofs.

Maya transform nodes can only have one input, either a key, an expression a constraint or any other connection to an other node, you can check this in Node Editor.

When you add a keys constrained object to an attribute that has no input, there is no change for the current connections, but if you add keys to an attribute that is already connected / constrained, then the connections need to change, there is no other way.

 

If you add keys to an attribute that is constrained the connections are not simply replaced, you get a blend node which allows you to keep the previous influence from the constraint and add the influence from the keys, but you can define the ratio on your own.

This value will be different for everyone, so whatever value is chosen here will not fit everyone's need in every case.

You maybe want to keep 100% override from the constraint, but others maybe want to completely override the constraint (as done currently with "0") or maybe prefer a default value of "0.5" .

 

 

So my previous recommendations are still all valid.

a) Only add keys to attributes that are not controlled by the constraint.

(This does not change anything related to the constraint and does not require the blend node)

b) Use the Blend Parent attribute to control the influence of the constraint and keys.

(Maybe create your own script for setting keys that sets the blend value as you like at the beginning.)

c) Use Animation Layers to add additional keys.

...

There are for sure more options.

 

You can also add a suggestion to Maya Ideas to be able to set a custom value for this in Preferences:

Help -> Speak Back -> Maya Ideas 

 

Again, nothing is broken or disconnected when adding keys to a constrained object, you just would prefer an other default value for blending.

 

 

 

 

 

Message 13 of 24
gimble
in reply to: mspeer

Hey,

 

thanks for taking the time to look in to it, appreciated. From your words on blending nodes etc I took a look at the animation preferences. I figured it out. I was right, a tick box fixed it 🙂

 

Message 14 of 24
mspeer
in reply to: gimble

Hi!

 

I never used this setting before, but I noticed the same options in the Preferences after I replied.

I am glad you found it too and it works for you.

Message 15 of 24
mcw0
in reply to: gimble

Learned something new today.  Thanks.  But I'm still lost as to why you would want to keyframe a constrained object and leave it constrained.  Why the extra data/nodes?  I thought you were going to set another keyframe to show you can animate on top of the constraint.  Maybe I'll try that.

Message 16 of 24
mcw0
in reply to: gimble

Are you using the "s" key to key all with no intention of actually animating the constrained channels? I guess that is the only reason I can think of where this is an issue.
Message 17 of 24
gimble
in reply to: mcw0

I'm an animator, we like to key everything, all controls. Let's say you
have a gun control, and you want to constrain that to the hand control. The
gun might have attributes on the control I want to key along with the
character. I hate having to hide controls on layers so I don't key them.
Does that make sense?
Message 18 of 24
grayryan102
in reply to: gimble

shout out for finding that tickbox, the child follows its parent now after setting a keyframe, however when i then key again there is no animation and just remains where ever the first key frame has been set. any idea how to fix this?

Message 19 of 24
kurzatkowski.peter
in reply to: gimble

Within bake simulation options - you can check "bake to:" new layer, it does preserve constraints and put keys on created layer.

Message 20 of 24
stephenkmann
in reply to: gimble

The connections aren't broken, there is a blendNode added between the constraint and the keys.  And a channel is added to the constrained object. 

 

The reason this is helpful is so you can blend on and off between the constraint to the keyed animation and then back again. 

 

Think of a hand tossing a ball. you can constrain the ball to the hand. and make the throwing motion. but you would then key the ball ( blending to it's own animation) , and a few frames later , key the ball up in the air. and then a few frames later, return the ball to the hand,, and key the blend to constraint back on again.   

 

 This saves  a ton of time that used to be done by having to constrain between two objects to control the ball, and then keying the weights on the constraint to make the transition between the two . Now you have 1 simple way to key the constraint on and off. 

hth

-=s

 

 

 

 

 

 

 

 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Technology Administrators


Autodesk Design & Make Report