Adobe After Effects CS3 Manuel d'utilisateur Page 558

  • Télécharger
  • Ajouter à mon manuel
  • Imprimer
  • Page
    / 677
  • Table des matières
  • MARQUE LIVRES
  • Noté. / 5. Basé sur avis des utilisateurs
Vue de la page 557
AFTER EFFECTS CS3
User Guide
553
See also
“Work with the Graph Editor” on page 184
Creating and modifying motion paths” on page 197
Writing expressions for source text
The Source Text property of a text layer is interpreted by expressions as a JavaScript String. You can use the pick whip
toretrievethesourcetextfromanothertextlayer;however,onlythestyleofthefirstcharacterofthedestinationlayer
is used.
For more information on the String object, consult a JavaScript guide.
You can use
"\r" in a string expression to start a new line of text. For example, to copy the original text from one
layer onto the same layer and repeat it in all uppercase characters on a new line, use the following expression:
text.sourceText + "\r" + text.sourceText.toUpperCase()
Adding a text layer to a composition and adding an expression to its Source Text property can be a great way to
examine the property values of other layers. For example, the following expression on a Source Text property reports
the name and value of the Opacity property for the next layer in the layer stacking order:
thisComp.layer(index + 1).name + "\rOpacity = " + thisComp.layer(index + 1).opacity.value
The following example reports the name of the footage item used as the source of the topmost image layer in the
stacking order at the current time that has its Video switch set.
source_footage_name = "";
for (i = 1; i <= thisComp.numLayers; i++){
if (i == index) continue;
my_layer = thisComp.layer(i);
if (! (my_layer.hasVideo && my_layer.active)) continue;
if (time >= my_layer.inPoint && time < my_layer.outPoint){
try{
source_footage_name = my_layer.source.name;
}catch(err1){
source_footage_name = my_layer.name
}
break;
}
}
source_footage_name
See also
Creating and editing text layers” on page 273
Add comments to an expression
If you write a complex expression and intend to reuse it later, you should add comments that explain what the
expression does and how its pieces work.
Type // at the beginning of the comment. Any text between // and the end of the line is ignored. For example:
// This is a comment.
Vue de la page 557
1 2 ... 553 554 555 556 557 558 559 560 561 562 563 ... 676 677

Commentaires sur ces manuels

Avenue 17 24 Apr 2024 | 16:19:09

What talented message