Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
1
Help us understand the problem. What are the problem?

More than 5 years have passed since last update.

@kitasenjudesign

AEでsetIntervalみたいなの

Aftereffectsのjsxで、
setIntervalみたいなの(scheduleTaskというメソッド)
で定期的に命令たたいて
レンダ―キューにコンポを追加していくスクリプトを書きました。


//選択されてるコンポを取得
var srcCompos=[];
for (var i=1; i<=app.project.items.length; i++)
{
    if( app.project.item(i).selected ){
        srcCompos.push(app.project.item(i));
    }
}

//テンプレート名を選択させる。
var t_name=prompt("select templete", "FLV_3M");

var taskID = 0;
var i=0;

//毎回実行するメソッド
var myFunc = function (){

    var compo = srcCompos[i];
    var renderque = app.project.renderQueue.items.add(compo);       
    renderque.outputModule(1).applyTemplate(t_name);
    i++;
    if( i>=srcCompos.length ){
        app.cancelTask(taskID);//終了
    }
}

//定期的に実行
taskID = app.scheduleTask('myFunc()', 250, true);


参考にしたページ

Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
1
Help us understand the problem. What are the problem?