Skip to main content
Inspiring
October 26, 2015
Answered

source text set value at time

  • October 26, 2015
  • 1 reply
  • 1094 views

Hey,

I am a begginer at AE scripting. I'd like to change text color over time. I have already done this with f.e. scale property. I'd like to do the same with color. So until now Ive changed the color once:

    //CHANGING SOURCE TEXT PROPERTIES {{{

        var compSourceText = comp.layer(1).property("Source Text");

        var compTextValue = compSourceText.value;

       

        compTextValue.fillColor = [1,  0,  0];

        compSourceText.setValue(compTextValue);   

    // }}}  

How can I change it at given time? Like here:

var compScaleProperty = comp.layer(1).property("Scale");

       

        compScaleProperty.setValueAtTime(5, [360, 360]);

        compScaleProperty.setValueAtTime(5.4,  [370, 370]);

        compScaleProperty.setValueAtTime(5.8,  [380, 380]);

        compScaleProperty.setValueAtTime(6.2,  [400, 400]);

        compScaleProperty.setValueAtTime(6.6,  [420, 420]);

        compScaleProperty.setValueAtTime(7,  [440, 440]);

I'd be very grateful for any help

This topic has been closed for replies.
Correct answer Dan Ebberts

I think you do it pretty much the same way:

var compSourceText = comp.layer(1).property("Source Text");

var compTextValue = compSourceText.value;

compTextValue.fillColor = [1,  0,  0];

compSourceText.setValueAtTime(0,compTextValue);  

compTextValue.fillColor = [0, 1,  0];

compSourceText.setValueAtTime(1,compTextValue);

etc.

Dan

1 reply

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
October 26, 2015

I think you do it pretty much the same way:

var compSourceText = comp.layer(1).property("Source Text");

var compTextValue = compSourceText.value;

compTextValue.fillColor = [1,  0,  0];

compSourceText.setValueAtTime(0,compTextValue);  

compTextValue.fillColor = [0, 1,  0];

compSourceText.setValueAtTime(1,compTextValue);

etc.

Dan

Inspiring
October 27, 2015

Works just fine:) Thanks. Is there a way to obtain a smooth transition between colors in time?

A

Dan Ebberts
Community Expert
Community Expert
October 27, 2015

I think you'd have to use a Fill Color Animator to do that.

Dan