Is it possible to drive keys with attributes?


#1

Hi.

Is there any way to control keys of a single animation curve without opening the Graph Editor? With attributes or in the viewport in some way maybe? (Without going into API)


#2

When you say “control keys”, what exactly are you trying to do? Adjust the time or value of existing animation keys? Or would driven keys provide the functionality you want (linking an attribute to another through an animation curve)?


#3

the curve in my scene is used for interpolation of incoming data to multiple objects. so it’d be faster to at least be able to change key positions in time and change the values. in my case time for me is influence radius and values are min and max influences. i’m using animCurveTU


#4

is it really not possible?


#5

My only guess would be to create a Callback if a attribute changes which then updates the keys


#6

If it doesn’t need to interface directly with the user pressing “s”, animcurves are rarely the most efficient or easiest solution. (I was stuck on this problem myself until very recently - despite what the docs say, it doesn’t seem like there is any way to influence the graphed properties of any animcurve node.)

The best solution I’ve found is the remapValue node. It’s massively faster than a driven key, and it’s more flexible. The only downside is that you need to specify the min and max values for the output range - if your values are constantly changing, this is a headache, since historically maya doesn’t provide any way to find those values of a set of data (although apparently there is a way now with the combinationShape node, of all things).

To interpolate between arbitrary values, I hook each value to a floatValue key on a remapValue node, and to the valueY of a linear nurbsCurve CV. Then take the maxY and minY values of the bounding box, and hook those to the outputMin and outputMax values of the remapNode. This has the added benefit of displaying your interpolation data in the scene, which I think is neat.


#7

very interesting. haven’t tried it this way. I’ll give it a shot. thanks