Page 1 of 1

[solved] Add Fill Color to Text Animator

Posted: February 25th, 2009, 11:34 am
by RestTaker
I'm trying to add a Fill Color property to the Text Animator, but every my try fails...

Here are some code:
==
var comp = app.project.activeItem;

var layers = comp.layers;

var text = layers.byName ("bla bla bla"); // it's a text layer

var text_animator = text.property ("Text").property ("Animators").property ("Animator 1");

var fill_color = text_animator.property ("Properties").addProperty ("Fill Color");
===

"Animator 1" is created by me, and already exists.

The error message: "Cannot add property Fill Color to this PropertyGroup".
It seams, that property "Fill Color" is already exists. But when I'm trying to setValue of this property it fails with error: "The property is hidden".

Thank you.

Re: Add Fill Color to Text Animator

Posted: February 25th, 2009, 1:45 pm
by Paul Tuersley
It works if I change the last line to:

var fill_color = text_animator.property("Properties").addProperty("ADBE Text Fill Color");

Re: Add Fill Color to Text Animator

Posted: February 26th, 2009, 1:17 am
by RestTaker
Thanks, it works ;-)

Changing value of Text Animator/ Fill Color

Posted: December 21st, 2009, 1:09 pm
by sbaden
I am trying to use your code to change the value of the fill color animator that already exists instead of adding a fill color animator. The script runs without any errors but doesn't change the color.

Code: Select all

//Set color for firstName_____________________________________________________________________________________

	var redValue = 100;
	var greenValue= 100;
	var blueValue= 100;

	var redDecimal = (redValue/2.55)/100;
	var greenDecimal = (greenValue/2.55)/100;
	var blueDecimal = (blueValue/2.55)/100;

	var textAnimator = firstNameLayer.property("Text").property("Animators").property("Animator 1").property.fillColor;

	var colorFirstName =  [redDecimal, greenDecimal, blueDecimal, 1];

//_____________________________________________________________________________________
Do I need some sort of setValue syntax?

Changing value of Text Animator/ Fill Color

Posted: December 21st, 2009, 2:01 pm
by sbaden
I've changed the code to this and still no luck...

Code: Select all

//Set color for firstName_____________________________________________________________________________________

	var redValue = 100;
	var greenValue= 100;
	var blueValue= 100;

	var redDecimal = (redValue/2.55)/100;
	var greenDecimal = (greenValue/2.55)/100;
	var blueDecimal = (blueValue/2.55)/100;

	var textAnimator = firstNameLayer.property("Text").property("Animator").property("Animator 1").property("Fill Color").setValue([redDecimal, greenDecimal, blueDecimal, 1]);

//_____________________________________________________________________________________

Re: [solved] Add Fill Color to Text Animator

Posted: December 22nd, 2009, 4:43 am
by Paul Tuersley
Try this:

Code: Select all

   var textAnimator = firstNameLayer.property("Text").property("Animators").property("Animator 1").property("Properties").property("Fill Color");
   textAnimator.setValue([redDecimal, greenDecimal, blueDecimal, 1]);

Re: [solved] Add Fill Color to Text Animator

Posted: August 12th, 2011, 7:16 am
by sbaden
Thank you Paul,

That worked perfectly!! :D