-
“Must be scalar” error – linear expression on array value
Hello, guys!
Some time ago I was trying to find a way to control the value of a keyframe through an expression, so that I could change the animation, but keep duration and, most of all, the ease I create on the graph editor. After doing some research, I came up with the following expression:
if (numKeys > 1){
newV2 = (link to slider);
v1 = valueAtTime(key(1).time);
v2 = valueAtTime(key(2).time);
linear(value,v1,v2,v1,newV2);
}else {value};
It works like a charm. All I have to do is create 2 keyframes (the second with symbolic value), edit the ease on the graphic panel and voilà. I’ve been using it a lot since then, especially when creating Essential Graphics to work on Premiere.
But there’s a problem: it only works for properties with one dimension, such as rotation or a separated dimension of the position property, for example. If I try to apply this on a 2-dimensional property, like scale or size, it fails, and AE tells me arguments must be scalar. Changing “value” for “time” inside the linear part has no effect either. The error continues, but instead of “argument 1” it is “argument 2”, then.
What exactly do I need to change to have it working on array properties?
I thank you in advance for your help.