与AE自带的选中在项目中显示图层源一个意思,这个是为了同时选中多个图层源。
可以直接拷贝到toolbar 里作为一个小按钮用。
function sleSource(){
app.beginUndoGroup("选中图层再项目窗口的源")
var avItem = app.project.activeItem;
if(!avItem){alert("先激活一个合成!")};
var l = avItem.selectedLayers;
if(l.length==0){alert("选中一些图层!")}
for(var i=l.length-1; i>=0; i--){
try{l[i].source.selected = 1;}catch(err){continue};//有的图层没有源偷懒直接给他try一下
l[i].source.selected = 1;
}
app.endUndoGroup()
}
sleSource();