Page 1 of 1

How to implement fill-color transition in script ?

Posted: November 17th, 2011, 7:41 pm
by visuall
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 ?

Code: Select all

...
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!

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

Posted: November 18th, 2011, 7:38 pm
by visuall
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:

Code: Select all

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

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

animator1.fillColor.setValueAtTime(3,[1,1,1,1]);
[/i]
" -- Answered by Dan Ebberts