您当前的位置: 首页 > 

插件开发

暂无认证

  • 3浏览

    0关注

    492博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

AfterEffect插件-常规功能开发-复制组合图层-js脚本开发-AE插件

插件开发 发布时间:2022-03-11 07:09:20 ,浏览量:3

文章目录
    • 1.算法程序
    • 2.作者答疑

1.算法程序

  AfterEffect(AE)插件是Adobe公司开发的特效制作软件,稳定快速的功能和特效,在视频制作领域使用非常广泛,本文向大家介绍如何在项目里进行复制组合图层功能。源代码如下所示:

{
	// Double-Up.jsx
	// 
	// This script creates duplicates of the layers in a composition and
	// lays them side by side with the original layers. You can use this 
	// script to compare different settings on the same footage.
	// 
	// Notes:
	// This script works best when it is initially applied to a footage layer 
	// that's the same size as and centered within its composition. 
	// Re-running the script allows you to double-up the previous layers.
	
	
	function DoubleUp()
	{
		var doubleUpData = new Object();
		doubleUpData.scriptName = "Double-Up";
		
		doubleUpData.strErrNoCompSel = "Select or open a composition, then try again.";
		
		doubleUpData.favorLongerDim = 0;	// set to 1 to lay side-by-side along longest dimension (width or height)
		
		var comp = app.project.activeItem;
		if ((comp == null) || !(comp instanceof CompItem)) {
			alert(doubleUpData.strErrNoCompSel, doubleUpData.scriptName);
			return;
		}
		
		var selLayers = new Array();
		for (var i=1; i comp.height);
		var xOffset = (doubleUpData.favorLongerDim == widthIsLonger) ? comp.width : 0;
		var yOffset = (doubleUpData.favorLongerDim == widthIsLonger) ? 0 : comp.height;
		
		app.beginUndoGroup(doubleUpData.scriptName);
		
		comp.width = comp.width * ((doubleUpData.favorLongerDim == widthIsLonger) ? 2 : 1);
		comp.height = comp.height * ((doubleUpData.favorLongerDim == widthIsLonger) ? 1 : 2);
		
		for (var i=0; i            
关注
打赏
1665481431
查看更多评论
0.0426s