Skip to main content
Participant
November 16, 2018
Answered

Swtiching Text Animation Direction

  • November 16, 2018
  • 1 reply
  • 1538 views

hey i'm working in text animation ( after effects cc 2018 )it's arabic/persian ( it's RTL yes )but the animation from template it's comes from left to righthow i can reverse than animation ( RTL Animation )here's screenshots and script in case maybe help

Code :

freq = effect("Frequency")("ADBE Slider Control-0001");

decay = effect("Decay")("ADBE Slider Control-0001");

if(effect("Random Time")("ADBE Checkbox Control-0001")==0){

retard = textIndex*thisComp.frameDuration*effect("Offset")("ADBE Slider Control-0001");

}else{

seedRandom(index*textIndex,timeless=true);

retard = random(0,1);}

t = time - (inPoint + retard);

startVal = [100,100,100];

endVal = [0,0,0];

duration = effect("Duration")("ADBE Slider Control-0001");

if (t < duration){

linear(t,0,duration,startVal,endVal);

}else{

amp = (endVal - startVal)/duration;

w = freq*Math.PI*2;

endVal + amp*(Math.sin((t-duration)*w)/Math.exp(decay*(t-duration))/w);

}

This topic has been closed for replies.
Correct answer Rick Gerard

can you give me a sample ?
i just changed like that
if i'm correct, sorry for my lack of knowledge
--
i did this and text is gone :

freq = effect("Frequency")("ADBE Slider Control-0001");

decay = effect("Decay")("ADBE Slider Control-0001");

if(effect("Random Time")("ADBE Checkbox Control-0001")==0){

retard = textTotal-textIndex*thisComp.frameDuration*effect("Offset")("ADBE Slider Control-0001");

}else{

seedRandom(textTotal-textIndex,timeless=true);

retard = random(0,1);}

t = time - (inPoint + retard);

startVal = [100,100,100];

endVal = [0,0,0];

duration = effect("Duration")("ADBE Slider Control-0001");

if (t < duration){

linear(t,0,duration,startVal,endVal);

}else{

amp = (endVal - startVal)/duration;

w = freq*Math.PI*2;

endVal + amp*(Math.sin((t-duration)*w)/Math.exp(decay*(t-duration))/w);

}


You left out the parentheses. You have to put in the whole arguement.

freq = effect("Frequency")("ADBE Slider Control-0001");

decay = effect("Decay")("ADBE Slider Control-0001");

if(effect("Random Time")("ADBE Checkbox Control-0001")==0){

retard = (textTotal-textIndex)*thisComp.frameDuration*effect("Offset")("ADBE Slider Control-0001");

         }else{

     seedRandom(index*(textTotal-textIndex),timeless=true);

     retard = random(0,1);}

t = time - (inPoint + retard);

startVal = [100,100,100];

endVal = [0,0,0];

duration = effect("Duration")("ADBE Slider Control-0001");

if (t < duration){

linear(t,0,duration,startVal,endVal);

}else{

amp = (endVal - startVal)/duration;

w = freq*Math.PI*2;

endVal + amp*(Math.sin((t-duration)*w)/Math.exp(decay*(t-duration))/w);

}

1 reply

Mylenium
Legend
November 16, 2018

You may need to modify the various occurances of textIndex to read (textTotal-textIndex) instead.

Mylenium

Community Expert
November 16, 2018

Mylenium has it right. There are two instances of textIndex so it will take you just a couple of seconds to change that to (textTotal-textIndex)

Text and word count in expressions always moves from left to right. Subtracting the number of characters from the total will reverse the direction.

Participant
November 16, 2018

can you give me a sample ?
i just changed like that
if i'm correct, sorry for my lack of knowledge
--
i did this and text is gone :

freq = effect("Frequency")("ADBE Slider Control-0001");

decay = effect("Decay")("ADBE Slider Control-0001");

if(effect("Random Time")("ADBE Checkbox Control-0001")==0){

retard = textTotal-textIndex*thisComp.frameDuration*effect("Offset")("ADBE Slider Control-0001");

}else{

seedRandom(textTotal-textIndex,timeless=true);

retard = random(0,1);}

t = time - (inPoint + retard);

startVal = [100,100,100];

endVal = [0,0,0];

duration = effect("Duration")("ADBE Slider Control-0001");

if (t < duration){

linear(t,0,duration,startVal,endVal);

}else{

amp = (endVal - startVal)/duration;

w = freq*Math.PI*2;

endVal + amp*(Math.sin((t-duration)*w)/Math.exp(decay*(t-duration))/w);

}