Skip navigation
visual-ly
Currently Being Moderated

How to implement fill-color transition in script ? Call setValueAtTime ? It doesn't work.

Nov 17, 2011 7:51 PM

Tags: #color #text

Hi Everyone!

 

The following code(setValueAtTime) doesn't support for fill-color transition, but this feature is supported by After Effects CS5.5 UI. So could you please give a hint about how to implement fill-color transition in script ?

 

...

var layer1 = app.project.item(1).layers.addText("Example Text");

var animator1 = layer1.Text.Animators.addProperty("ADBE Text Animator");

var selector1 = animator1.Selectors.addProperty("ADBE Text Selector");

animator1 = animator1.Properties;

animator1.addProperty("ADBE Text Fill Color").setValueAtTime(0,[0xff,0xe0,0x0,1]);

animator1.fillColor.setValueAtTime(1,[0xff,0x00,0xe0,1]);

animator1.fillColor.setValueAtTime(2,[0x00,0xe0,0xff,1]);

animator1.fillColor.setValueAtTime(3,[0xff,0xff,0xff,1]);

animator1.addProperty("ADBE Text Rotation X").setValue(ratationX);

animator1.addProperty("ADBE Text Rotation Y").setValue(rotationY);

animator1.addProperty("ADBE Text Rotation").setValue(rotation);

animator1.addProperty("ADBE Text Scale 3D").setValue([100,300,100]);

animator1.addProperty("ADBE Text Position 3D").setValueAtTime(0,[-500,-300,-300]);

animator1.position.setValueAtTime(5,[0,0,0]);

selector1.start.setValue(0);

selector1.end.setValue(100);

selector1.offset.setValueAtTime(0,-100);

selector1.offset.setValueAtTime(3,100);

selector1.advanced.shape.setValue(2);

selector1.advanced.easeLow.setValue(100);

...

 

 

 

Thanks In Advance!

 
Replies
  • Currently Being Moderated
    Nov 17, 2011 10:15 PM   in reply to visual-ly

    Your color channels need to be between 0 and 1, like this:

     

    animator1.fillColor.setValueAtTime(1,[1,0,.878,1]);

    animator1.fillColor.setValueAtTime(2,[0,.878,1,1]);

    animator1.fillColor.setValueAtTime(3,[1,1,1,1]);

     

     

    Dan

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points