PDA

View Full Version : Converting keyframes to driven keys?


DeepThought
07-01-2010, 08:14 PM
Hello. I'm having a problem here that I hope you guys can help me with.

I created a bunch of keyframes on a timeline (28 to be exact). I created these in hopes of creating a lip-synching rig that controlled each of these keyframes by using phoneme attributes I created. To make these attributes have value I need to use driven keys. However, the problem arrises when I try to convert these timeline keyframes into driven keys. I simply don't know how to do it easily. I've searched on the internet for a while, and haven't came across any satisfactory answers. Does anyone know how to do this, if it can even be done at all?

What I've discovered so far is that driven keys do use animation curves just like keyframe animation. However, for my rig there are thousands of animation curves created via driven keys, making editing them extremely impractical. There has to be a better way than that, right?

mduvekot
07-02-2010, 01:41 AM
It's pretty straightforward.

Say you have animated an object's translateX and now you'd like to drive that with some other attribute.

Then you would connect the [driver].[attribute] to [driven]_translateX.input where driven_translateX is the animCurve node for the translateX of the previously animated, now driven object.

connectAttr -f [driver].[attribute] to [driven]_[attribute].input

for example

connectAttr -f locator.translateY pCube1_translateX.input;

This isn't entirely how it should be though; stricktly speaking you ought to use a animCurveUL for set driven keys, and because you started out with keyframe animations, you're now using an animCurveTL. I've not had any problems with this, but you might want to consider finding ways to do it correctly.

tonytouch
07-02-2010, 04:26 PM
pretty nice, is also the possibility to "disconnect" the "TIME" from the input of an animCurve .

that way you can e.g. connect a custom attribute into the input - and once you animate it , you do a lot of great things . ( e.g. you animate something over 100 frames from 0 to 100 , and then connect your customattribute , in order to do adjustments to the timing )

JayG
07-06-2010, 10:40 PM
Cool idea, I always assumed a 'T' curve would not function as an SDK.

To do this I'd just write it and loop through all your animCurves, grab the keys/values, disconnect/delete, create an SDK and adjust the values accordingly.

setDrivenKeyframe is the command.

EightBit
06-14-2011, 05:22 AM
Cool idea, I always assumed a 'T' curve would not function as an SDK.

To do this I'd just write it and loop through all your animCurves, grab the keys/values, disconnect/delete, create an SDK and adjust the values accordingly.

setDrivenKeyframe is the command.
Could you provide a simple example of copying a couple KF from an anim curve and moving them to an SDK curve?
Thanks.

JasonJune2009
06-15-2011, 12:50 AM
there's already a mel script , search in the http://www.creativecrash.com/maya/downloads/scripts-plugins/animation

EightBit
06-15-2011, 02:20 AM
Got it, thanks.

CGTalk Moderation
06-15-2011, 02:20 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.