Help us understand the problem. What is going on with this article?

AEでsetIntervalみたいなの

More than 5 years have passed since last update.

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


参考にしたページ

https://sites.google.com/site/annamillersclub/script-menu/gyakubikiscript

kitasenjudesign
Blog https://kitasenjudesign.hatenablog.com/
http://kitasenjudesign.com/
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
Comments
No comments
Sign up for free and join this conversation.
If you already have a Qiita account
Why do not you register as a user and use Qiita more conveniently?
You need to log in to use this function. Qiita can be used more conveniently after logging in.
You seem to be reading articles frequently this month. Qiita can be used more conveniently after logging in.
  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
ユーザーは見つかりませんでした