“向下”复制图层

[sc name=”zhuanzai” author=”朝倉すぐる” link=”https://twitter.com/SgrGuitarOrgan” ][/sc]

“向下”复制图层

默认AE是“向上”复制的,该脚本允许“向下”复制。

如果你把它放在 ScriptUI Panels 文件夹中,它有一个 UI,如果放在 Scripts 文件夹中,它可以在没有 UI 的情况下工作。

/*-------------------------------------
Duplicate Under It

Version History
1.0.0 [Current version]  -  Sep 02, 2021
    Initial release
-------------------------------------*/

//______Files Path______
var thisFile = new File(this);
var thisFolderPath = thisFile.path;
//______Build Main Panel______
function buildUI(thisObj){
    if(thisObj instanceof Panel){
        var win = thisObj;
    }else{
        dupUnderIt();
    }       
    return win;
}

try{
    var win = buildUI(this);
    var buttonRect = [0, 0, 100, 30];
    var panelButtonSpace = [5, 5, 5, 5];
    var buttonSpace = [55, 0, 55, 0];
    var buttonA = win.add("Button", panelButtonSpace + buttonRect, "Duplicate");

    function dupUnderIt(){
        app.beginUndoGroup("dui");
        var comp = app.project.activeItem;
        var slLayers = comp.selectedLayers
        for(i=0; i<slLayers.length; i++){
            slLayers[i].duplicate();
            slLayers[i].moveBefore(comp.layer(slLayers[i].index-1));
            slLayers[i].selected = false;
            comp.layer(slLayers[i].index+1).selected = true;
        }
        app.endUndoGroup();
    }
    buttonA.onClick = function(){
        dupUnderIt();
    }
}catch(e){
}
//try catch <-- To make it work even if you don't have it in ScriptUI Panels.

 

给TA充电
共{{data.count}}人
人已充电
AE开发脚本开发

[AE脚本]批量删除表达式

2021-9-10 14:05:11

AE开发脚本开发

一键RGB分离

2021-9-11 11:08:07

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
今日签到
搜索