View Single Post
  #3   Spotlight this post!  
Unread 06-06-2014, 19:07
ArtemusMaximus's Avatar
ArtemusMaximus ArtemusMaximus is offline
Enginerd
FTC #11722
Team Role: Coach
 
Join Date: Apr 2014
Rookie Year: 2014
Location: Canada
Posts: 248
ArtemusMaximus is a name known to allArtemusMaximus is a name known to allArtemusMaximus is a name known to allArtemusMaximus is a name known to allArtemusMaximus is a name known to allArtemusMaximus is a name known to all
Re: Adobe AfterEffects CS6 scripting

Quote:
Originally Posted by Metonym View Post
Don't leave us hanging . How did you do it?
Background:
this part of the project is for the ending credits for dance school year end show video that I am working on. This year I wanted to do something interesting with credits and decided to do them in AfterEffects. There are over 300 kids, so I quickly realized that doing all of them manually will take a while.
Setup:
  • Each Dance title is in it's own composition
  • Each dancers name is in it's own composition
  • Each Dance compilation (dance title and dancer's names) is in it's own composition
Process:
  1. I created a "_template" for the dancers name. copied & paste as many times as there names. "_" so that copies will paste at the beginning of the Project List.
  2. Compiled list of dancers in Excel.
  3. created formula to make the corresponding code.
actual code snippet is here:
PHP Code:
var myProperty "Source Text";
var 
myComp app.project.item(1); var CompName "ArtemusMaximus"; var Text1 "Artemus"; var Text2 "Maximus";myComp.name CompNamemyComp.layer(2).property(myProperty).setValue(Text1);  myComp.layer(3).property(myProperty).setValue(Text2);
var 
myComp app.project.item(1); var CompName "Chief Delphi"; var Text1 "Chief"; var Text2 "Delphi";myComp.name CompNamemyComp.layer(2).property(myProperty).setValue(Text1);  myComp.layer(3).property(myProperty).setValue(Text2); 
Because it's JavaScript based I was able to flatten code into one line and made Excel formula much easier to create. So "pretty" code would look like this:

PHP Code:
var myProperty "Source Text";

var 
myComp app.project.item(1); 
var 
CompName "ArtemusMaximus"
var 
Text1 "Artemus"
var 
Text2 "Maximus";
myComp.name CompName
myComp.layer(2).property(myProperty).setValue(Text1);  
myComp.layer(3).property(myProperty).setValue(Text2);


var 
myComp app.project.item(1); 
var 
CompName "Chief Delphi"
var 
Text1 "Chief";
var 
Text2 "Delphi";
myComp.name CompName
myComp.layer(2).property(myProperty).setValue(Text1);  
myComp.layer(3).property(myProperty).setValue(Text2); 
Here I created test credits. Nothing fancy, but it's better than before:
https://www.youtube.com/watch?v=n8_FXIuH9iQ
Reply With Quote