Hope is a Dream. Dream is a Hope.

非公開ブログは再開しました。

スライドショーの作り方 after effectsでの簡単な作り方 | 結婚式の余興スライドショー

最近、結婚式用のスライドショームービーを自動で作るスクリプトを描いていまう。

自動作成のスクリプト自体はおおむね仕上がったので、

今日は、ユーザが操作するUIを作って見ます。

after effectsでのUIを作るのは始めてなので、

初心者コードとなりますがご了承ください。

いつも参考にさせていただいております。 After Effectsユーザーのための、プログラミング入門 その10 後編 AE_Dialogs_due C#コントロール集 AEスクリプトのUIデザイン at AEP Project

f:id:hope_is_dream:20141026111716p:plain

// (function(){
var res = 
"window {\
    info1: Panel{orientation:'column', alignChildren:'right',\
        text:'Slide Show info',\
        n1: Group{ orientation: 'row',\
            st: StaticText{text:'Photo :'},\
            sp: StaticText{characters:30, text:'写真を保存しているフォルダを教えて-o-/'},\
            bt: Button{text:'open',property:{name:'photo folder opBtn'}}, \
        },\
        n2: Group{ orientation: 'row',\
            st: StaticText{text:'Message:'},\
            sp: StaticText{characters:30 ,text:'メッセージを保存しているフォルダを教えて-o-/'},\
            bt: Button{text:'open',property:{name:'msg folder opBtn'}}, \
        },\
    },\
    info2: Panel { orientation: 'column', alignment:['fill', 'right'], alignChildren:'right',\
        text: 'Create movie',\
        okBtn: Button { text: 'スライドショーを作る', alignment:['fill','top'] ,property:{name:'createBtn'}}\
        ccBtn: Button { text:'コンポジションをリセットする', alignment:['fill','top'] ,property:{name:'ccBtn'}} \
    } \
    dlg: Group { orientation: 'row', \
            okBtn: Button { text: 'OK',property:{name:'okBtn'}}, \
            ccBtn: Button { text:'Cancel',property:{name:'ccBtn'}} \
    } \
}";
var win = new Window (res); 
// win.center();
win.show(); 


win.info1.n1.bt.onClick= function(){
    var folderObj = Folder.selectDialog("Select");
    this.parent.sp.text = folderObj;
    $.writeln(this.text);
    $.writeln(folderObj);
}
win.info1.n2.bt.onClick= function(){
    var folderObj = Folder.selectDialog("Select");
    this.parent.sp.text = folderObj;
    $.writeln(this.text);
    $.writeln(folderObj);
}
win.dlg.okBtn.onClick= function(){
    $.writeln(this.text);
    win.close();
}
win.dlg.ccBtn.onClick= function(){
    $.writeln(this.text);
    win.close();
}



// }());

参考

いつもお世話になっております。

Adobe CC 用のリファレンス Adobe CC バージョンJavaScript ファレンス

50個近いスクリプト集。適当に中身をのぞいて勉強させていただいております。 redefinery.com: rd: scripts

26個のスクリプト集。勉強させていただいております。 Nabscripts::Downloads

こちらは実践的なTipsが紹介されております。 [http://hiroshisaito.net/blog/after-effects-scripting-notes.html#%__2:title]

After Effectsユーザーのための、プログラミング入門 その8 小物toolsスクリプト at AEP Project

まとめ

とりあえず、見よう見真似で作っているので、時々でてくるエラーに対処できません。

少しずつ進めながら、空いた時間でadobeスクリプトリファレンスを読みながら解読しているところです。

http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/scripting/pdfs/javascript_tools_guide.pdf