Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
1

Expression Selector Help position with anticipation

Explorer ,
Sep 21, 2023 Sep 21, 2023

I'm a novice when it comes to expressions and the such. I've been trying to use the expression selector to make templates of repeated text animations I use. The one I'm having dificulties with is the anticipation text animations. What I want to do is move the characters in the opposite direction of the value I have for half the duration and then the other half move the character down to the value I have placed in. I've used linear expressions and i'm tearing my hair out cause it's not working correctly.

 

This is what I have now and I was going to add easing settings once it was setup. I think there's probably a better and more elegant solution to what I have:

 

startVal = 100;

endVal = -0;

os = .35; // anticipation amount

durOUT = 2; // length of animation

earlyOUT = .5; // added time to hold on the end value

delay = (5)*.01; // the delay between Characters

speedIndex = 1.5; // speed of text moving??

myDelay = delay * textIndex;

timeOUTa = (time - outPoint + durOUT + earlyOUT) * speedIndex - myDelay; // start outgoing process for anticipation

timeOUTb = (time - outPoint + durOUT - (durOUT*.125) + earlyOUT) * speedIndex - (myDelay*.5); // start the outgoing process for the final value

ta = linear(timeOUTa -(durOUT *.1), 0, durOUT/textTotal + (durOUT * .01), endVal, startVal * - os);

tb = linear(timeOUTb +(durOUT *.1), durOUT*.5, (textIndex/textTotal) + (durOUT* .01) , endVal, startVal - (startVal * - os));

ta + tb

 

Any help would be greatly appreciated. Thanks!

TOPICS
Expressions , How to , Scripting
211
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Sep 21, 2023 Sep 21, 2023
LATEST

Oh Also, I combined a "Flow" curve that works but it's heavy:

/* ---------- Flow Function Declarations ---------- */
function customBezier(t,tMin,tMax,value1,value2,bezierPoints){if(arguments.length!==6)return value;var a=value2-value1;var b=tMax-tMin;var c=clamp((t-tMin)/b,0,1);if(!(bezierPoints instanceof Array)||bezierPoints.length!==4)bezierPoints=[0,0,1,1];return a*h(c,bezierPoints)+value1;function h(f,g){var x=3*g[0];var j=3*(g[2]-g[0])-x;var k=1-x-j;var l=3*g[1];var m=3*(g[3]-g[1])-l;var n=1-l-m;var d=f;for(var i=0;i<5;i++){var z=d*(x+d*(j+d*k))-f;if(Math.abs(z)<1e-3)break;d-=z/(x+d*(2*j+3*k*d));}return d*(l+d*(m+d*n));}}
/* ---------- Flow Function Declarations ---------- */
// Variables
var lyrExp = effect("Elastic Character Control");
var dpEase = lyrExp("Ease Strength");
var os = lyrExp("Overshoot Amount");
var EaseLow = [0.15, os, .85, 1];
var EaseMed = [.3, os, .65, 1];
var EaseHigh = [.5, os, .4, 1];
var EaseExtreme = [.7, os, .5, 1];
var dpArr = [EaseLow, EaseMed, EaseHigh, EaseExtreme];
var animationStartTime = lyrExp("Duration [ IN, OUT ]")[1];
var animationEndTime = 0;
var startValue =100;
var endValue = 0;
var delay = lyrExp("Delay Index") * .01;
var Speed = lyrExp("Speed Index");
var earlyOUT = lyrExp("Early OUT Pos (seconds)");
var myDelay = delay * textIndex;
var t = (time - outPoint + earlyOUT + animationStartTime )*Speed - myDelay;
// Function
if (numKeys > 0) {
var nearestKeyIndex = nearestKey(time).index;
if (key(nearestKeyIndex).time > time) nearestKeyIndex--;
if (nearestKeyIndex === 0 || nearestKeyIndex === numKeys) {
startValue = endValue = value;
} else {
animationStartTime = key(nearestKeyIndex).time;
animationEndTime = key(nearestKeyIndex + 1).time;
startValue = key(nearestKeyIndex).value;
endValue = key(nearestKeyIndex + 1).value;
}
}
customBezier(t, animationStartTime, animationEndTime, startValue, endValue,dpArr[dpEase-1]);
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines