Expressions/Scripts/Presets

Moderator: Paul Tuersley

 
visuall
Topic Author
Posts: 2
Joined: Thu Nov 17, 2011 6:55 pm

How to implement fill-color transition in script ?

Thu Nov 17, 2011 7:41 pm

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!
 
visuall
Topic Author
Posts: 2
Joined: Thu Nov 17, 2011 6:55 pm

Re: How to implement fill-color transition in script ?

Fri Nov 18, 2011 7:38 pm

I've gotten an answer from Adobe After Effects Scripting Forum, it now works excellently.

"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]);

" -- Answered by Dan Ebberts

Who is online

Users browsing this forum: No registered users and 2 guests