[solved] Add Fill Color to Text Animator

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
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.
Last edited by RestTaker on February 26th, 2009, 1:17 am, edited 1 time in total.
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

It works if I change the last line to:

var fill_color = text_animator.property("Properties").addProperty("ADBE Text Fill Color");
sbaden
Posts: 35
Joined: June 16th, 2009, 1:07 pm
Location: Santa Clarita, CA

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?
sbaden
Posts: 35
Joined: June 16th, 2009, 1:07 pm
Location: Santa Clarita, CA

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

//_____________________________________________________________________________________
Paul Tuersley
Posts: 704
Joined: June 5th, 2004, 7:59 am
Location: London, UK

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]);
sbaden
Posts: 35
Joined: June 16th, 2009, 1:07 pm
Location: Santa Clarita, CA

Thank you Paul,

That worked perfectly!! :D
Post Reply