0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

今スク コンポジションのデュレーション変更&中身のレイヤーのアウトポイントをデュレーション秒に変更

Last updated at Posted at 2019-01-30

もう記事とかじゃなしにメモとしてQiitaを使います。

今日使ったスクリプト略して「今スク」というタイトルでとりあえず、メモ記事を投稿してきます。
簡単なスクリプトは基本的に保存しない主義ですが、やっぱりコピペで使えたら便利よね!
ってことで投稿します。

今日のスクリプト

コンポジションのデュレーションを変更して、その中にある全てのレイヤーのアウトポイントを
コンポジションのデュレーション秒数に変更します。

Extendscript

var targetNum = 20;
app.beginUndoGroup("undo");
for (var i = 1; i <= app.project.numItems; i++){
    var myComp = app.project.item(i);
    if (myComp.selected && myComp instanceof CompItem == true){
        app.project.item(i).duration=targetNum;
        for (var j =1 ; j <=  app.project.item(i).numLayers ; j++){
            $.writeln(app.project.item(i).layer(j))
            app.project.item(i).layer(j).outPoint = targetNum;
        }
    }
    else if (myComp.selected && myComp instanceof CompItem == false){
        alert("コンポジションを選択して下さい。")
    }
}
app.endUndoGroup();

説明

とりあえずプロジェクトのアイテムを一旦すべて読み込んで、そのアイテムが選択されていたら
デュレーション変更して、さらにその選択されているアイテム(コンポジション)の中のレイヤーのアウトポイントを変更してます。

※一旦全てのアイテムを読み込んでるのは全くもって意味ないです。逆に負荷がかかっていると思います(笑)
でもたまには使わないのも使わないと忘れるので使っているだけです。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?