3DCG屋さんの活動記録

PROFILE ★★こんな人です

映像制作会社でクリエイティブの修行中。日ごろはMaya&AEを中心にいろんなCGソフトを触りながら、TD寄りの作業が好きで、インタラクティブな体験型空間演出をやりたいと模索中。面白いこと新しいこと大好きな『素直』でいつづける

2019年4月1日月曜日

AEで時短Scriptいろいろ検証


■複数のフッテージ名をクリップボードにコピー

//★フッテージ名をリストで取得したいとき★
//Projectパネルで複数選択してScript実行
//あとはエクセルに貼り付け、データ/テキストから列へ/カンマONでOK/コピーして形式を選択して貼り付け/列と行の入れ替え。

var myItems = app.project.selection;
var myItemName = new Array(app.project.selection.length);

for (var i=0; i <myItems.length; i++){
    myItemName[i] = myItems[i].name;
}

//alert(myItemName);
prompt("test",myItemName);

----
参考
http://www.openspc2.org/reibun/AfterEffects6.0/JavaScript/ref/Global/prompt/index.html
https://aruo.net/arbk/blog/article/change_comma_separated_data_into_cells_on_spreadsheets



■コンポジションの複製


■レイヤーの置き換え


■ その他 雑メモ

//選択したアイテムをリスト化(名前取得) ★
var selItem = app.project.selection; //選択しているコンポジションをリスト化 
var selName = [] ; //それの名前を入れるリスト
var newCompList = []; //複製したコンポのリスト

//基礎勉強の部分
//alert(selItem); //選択したアイテムタイプ名の表示
//alert(selItem[0].name); //最初に選択したアイテム名表示
//alert("選択したコンポジションの数     "+selItem.length); //コンポジションの数

for(i=0;i<selItem.length;i++){
    selName.push(selItem[i].name); //選択アイテム名をリストに追加
}


//Lv1コンポ(親)の複製
//コンポジション複製:
newComp = selItem[0].duplicate(); //選択したコンポを複製
newComp.name = selName[0]+"_dupCmp";  //複製したコンポの名前変更
newCompList.push(newComp);

//Lv2コンポの複製
//コンポジション複製:
newComp = selItem[1].duplicate(); //選択したコンポを複製
newComp.name = selName[1]+"_dupCmp";  //複製したコンポの名前変更
newCompList.push(newComp);
//コンポ内のレイヤー置き換え
newCompList[0].layer(3).replaceSource(newCompList[1],false);

alert(selName); //コンポジションのリスト名取得と表示
alert(newCompList);


 newComp.duration = shotComp[i].duration; //複製したコンポの尺変更(秒で)
 newComp.parentFolder = selItem[2];
 newMSKComp.push(newComp);



■フォルダ選択ダイアログ
http://nakatoji.lolipop.jp/index.php/extendscript/fileaccess/fileaccess-list/374-2014-06-04-20-42-9





0 コメント:

コメントを投稿