Skip to main content
Sulaco
Inspiring
February 4, 2016
Answered

Expression prevents multi coloured text, how to fix

  • February 4, 2016
  • 1 reply
  • 1611 views

I have been looking around the Internet for a blinking cursor type effect. Found a couple different solutions, but this one worked the best for me : http://cgi.tutsplus.com/tutorials/quick-tip-type-on-text-preset-with-blinking-cursor--ae-18769

It works great! Problem is I want multi coloured text and if I apply this expression to my text, it becomes one colour. I know pretty much nothing about expressions, so I have absolutely no idea why this happens. The other expression based solutions worked fine with multi-coloured text. You can find the expression below, it's mainly gobbledygook to me ... Was hoping someone here would know of a workaround or solution?


L = text.sourceText.length;

PT = time - thisLayer.inPoint;

T = PT *effect("Speed")("Slider") - effect("Start At")("Slider")*effect("Speed")("Slider");

F = Math.round(PT% 1);

if(F == 1 | (T<L & T>0) ){Fl = "_";}else{Fl = "";}

substr(0,T) + Fl

This topic has been closed for replies.
Correct answer Sulaco

>Does AE support different White Spaces? Or is it just the standard white space? Would be perfect to use a invisible character, like a white space. Would a double space be detectable?

Yes, I think you could detect a hard space, or two consecutive spaces.

>You lost me completely, what is a Range Selector and how does that affect the colour?

If you twirl open the text layer and do Animate > Fill Color > RGB, you'll get a Fill Color animator with a Range Selector. If you then do Add > Selector > Expression you'll get an expression selector. If you twirl open the expression selector, you'll see the Amount property. Twirl that open and you'll see where the expression goes.

Dan


I actually came up with a solution, don't know why this didn't occur to me before! I blame lack of sleep! It's not terribly elegant, but at least it works and I believe it's the most efficient way of doing this out of all the things I have tried. I simple made two layers containing the exact same text, but each layer has a different text colour. Then I applied the type effect and used a mask to reveal the correct text colour were needed... It works and no more expressions involved... YAY!

1 reply

Dan Ebberts
Community Expert
Community Expert
February 5, 2016

Once you apply an expression to source text, all the characters get the same formatting as the first character. You might be able to set something up with Fill Color animators and Expression Selectors, but it would depend on what you're trying to do.

Dan

Sulaco
SulacoAuthor
Inspiring
February 5, 2016

Thank you for you reply Dan! I have attached a picture of what I am working on, for simplicities sake. I am creating a text frame and paste all the text into it, then I want to have the expression type all the lines, from top to bottom. Each line will be coloured according to the attached picture, IE a total of two different colours being used. I need to do this with several text frames, so it would be great to have a simple as possible work flow.

Dan Ebberts
Community Expert
Community Expert
February 5, 2016

Assuming your text is white, you should be able to do it with a yellow Fill Color animator and an Expression Selector with this for the Amount:

if (textIndex > 6) 100 else 0

You'd have to adjust this, based on the length of the TITLE part, unless you can come up with a clever algorithm to detect it automatically (which would be easier if the first one was "TITLE 1").

Dan