Activity › Forums › Adobe After Effects Expressions › Select Every Other Character Excluding Spaces Within a Text Animator
-
Select Every Other Character Excluding Spaces Within a Text Animator
Posted by George Goodman on June 10, 2014 at 4:26 pmI’m looking for something along the lines of this:
if (textIndex%2==0) execute this animator
then I want to create a separate animator that says
if (textIndex%2==1) execute this animator
I’m not really sure the proper way to do this though. Also, as the title says, i’d like to exclude spaces.
Thanks in advance!
“|_ (°_0) _|”
Sincerely,
George
http://www.vimeo.com/georgegoodman
http://www.linkedin.com/in/georgefranklingoodmanGeorge Goodman replied 11 years, 11 months ago 2 Members · 6 Replies -
6 Replies
-
Dan Ebberts
June 10, 2014 at 4:46 pmAdd your two Animators and set the max property values.
Add an Expression Selector to each Animator and delete the Range Selectors.
Set each Expession Selector’s “Based On” property to “Characters Excluding Spaces”
Add this expression to the Amount property of one selector:textIndex%2 ? 100 : 0
Add this to the other:
textIndex%2 ? 0 : 100
Dan
-
George Goodman
June 10, 2014 at 4:53 pmThanks Dan!
Quick question. What is the syntax saying when you use “? 100 : 0” is it just, “if true yes, if false no?”
Also, I had a semi solution that I was using in the screenshot below. Could you possibly explain to me why when I keyframed the position value that a value of 8,000 only moved the characters about 200 pixels?
7599_screenshot20140610at12.45.45pm.png.zip
“|_ (°_0) _|”
Sincerely,
George
http://www.vimeo.com/georgegoodman
http://www.linkedin.com/in/georgefranklingoodman -
Dan Ebberts
June 10, 2014 at 5:03 pmThe ? means if the preceding was true, do the first thing, otherwise do the second thing (the part after the :).
If you want to get the full 8000, your amount expression would need to evaluate to 100. It looks like the most it could be is 1.
Dan
-
George Goodman
June 10, 2014 at 5:08 pmThanks! That makes a lot of sense. The logic of the expression selector has always eluded me, but that helps. One last question.
What if I wanted to then affect it in order from left to right. So essentially combining something like the expression below with the index selector. Make sense?
swings=3;
timeOffset=0.25;v=valueAtTime(time-timeOffset*textIndex/textTotal)[0];
anim=2*Math.PI*v/100;
amp=easeOut(v,0,100,100,0);
Math.cos(anim*swings)*amp;“|_ (°_0) _|”
Sincerely,
George
http://www.vimeo.com/georgegoodman
http://www.linkedin.com/in/georgefranklingoodman -
Dan Ebberts
June 10, 2014 at 6:22 pmI can’t tell exactly what you’re trying to do there, but I have a couple of expression selector examples here that might be of some use:
https://www.motionscript.com/articles/bounce-and-overshoot.html#calc-overshoot
Dan
-
George Goodman
June 10, 2014 at 6:47 pmEssentially the motion in this video as if these blocks were text. I want to isolate the text first in a group based on the character being odd or even and then bring them in sequentially, but still in order respective to the entirety of the text. Hmm, tough to explain.
7600_comp1.mov.zip
(Currently using these blocks as a track matte to reveal text)“|_ (°_0) _|”
Sincerely,
George
http://www.vimeo.com/georgegoodman
http://www.linkedin.com/in/georgefranklingoodman
Reply to this Discussion! Login or Sign Up