-
[AE脚本开发]ScriptUI在面板中增减控件
// ScriptUI在面板中增减控件 v1.0.0 2022-02-16 // Raymond Yan 2022 (RaymondClr@outlook.com / QQ: 1107677019) var mainWindow = new Window("palette", "主界面"); var group1 = mainWindow.add("group"); var group2 = mainWindow.add("group"); group2.orientation = "column"; var button1 = group1.add("button", undefined, "添加按钮"); var button2 = group1.add("button", undefined, "移除按钮"); var count = 1; button1.onClick = function () { group2.add("button", undefined, "按钮" + count++); mainWindow.layout.layout(true); }; button2.onClick = function () { count--; if (count <= 0) count = 1; group2.remove(group2.children.length - 1); mainWindow.layout.layout(true); }; mainWindow.show();- 0
- 0
- 194
-
【AE脚本】检测是否勾选"允许写入文件和访问网络"
function writingFilesEnabled() { var errStrings = { errLineOne: localize("运行此脚本需要设置首选项。"), errLineTwoStart: localize("请转至"), errLineTwoEnd: localize("部分,并确保已经勾选了“允许脚本写入文件和访问网络”。"), sectionGeneral: localize("应用程序首选项中的“常规”"), sectionScripting: localize("“脚本和表达式”") } var version12Check = ( parseFloat( app.version ) > 12.0 || ( parseFloat( app.version ) === 12.0 && app.buildNumber >= 264 ) || app.version.substring( 0, 5 ) !== "12.0x" ); var mainSectionStr = ( version12Check ) ? "Main Pref Section v2" : "Main Pref Section"; var version16Check = ( parseFloat( app.version ) > 16.0 ); var securitySetting = app.preferences.getPrefAsLong( mainSectionStr, "Pref_SCRIPTING_FILE_NETWORK_SECURITY" ); var errSecuritySetting = [ errStrings.errLineOne, [ errStrings.errLineTwoStart, ( version16Check ) ? errStrings.sectionScripting : errStrings.sectionGeneral, errStrings.errLineTwoEnd ].join( " " ) ].join( "\n" ) if ( securitySetting === 0 ) { alert( errSecuritySetting ); ( version16Check ) ? app.executeCommand( 3131 ): app.executeCommand( 2359 ); } return ( securitySetting === 1 ); }- 0
- 0
- 380
-
【AE脚本】获取时间相关信息
其他的,请自行搜索JS 时间 脚本获取当前系统时间 var myDate = new Date(); myDate.getYear(); //获取当前年份(2位) myDate.getFullYear(); //获取完整的年份(4位,1970-????) myDate.getMonth(); //获取当前月份(0-11,0代表1月) myDate.getDate(); //获取当前日(1-31) myDate.getDay(); //获取当前星期X(0-6,0代表星期天) myDate.getTime(); //获取当前时间(从1970.1.1开始的毫秒数) myDate.getHours(); //获取当前小时数(0-23) myDate.getMinutes(); //获取当前分钟数(0-59) myDate.getSeconds(); //获取当前秒数(0-59) myDate.getMilliseconds(); //获取当前毫秒数(0-999) myDate.toLocaleDateString(); //获取当前日期 var mytime=myDate.toLocaleTimeString(); //获取当前时间 myDate.toLocaleString( ); //获取日期与时间- 0
- 0
- 119
-
ScriptUI点击控件弹出设置界面示例
// ScriptUI点击控件弹出设置界面示例 v1.0.0 2022-01-16 // Raymond Yan 2022 (RaymondClr@outlook.com / QQ: 1107677019) var mainWindow = new Window("palette", "主界面"); var getWindow1 = new SingletonWindow("palette", "设置面板一"); var getWindow2 = new SingletonWindow("palette", "设置面板二"); var button = mainWindow.add("button", undefined, "设置"); button.onClick = function () { var settingWindow1 = getWindow1(); var checkBox = settingWindow1.add("checkBox", undefined, "一个复选框"); settingWindow1.show(); checkBox.onClick = function () { alert(this.text); }; var settingWindow2 = getWindow2(); var button = settingWindow2.add("button", undefined, "一个按钮"); settingWindow2.show(); button.onClick = function () { alert(this.text); }; }; function SingletonWindow(type, name) { var container = null; return function () { if (container === null || !container.visible) container = new Window(type, name); return container; }; } mainWindow.show();- 0
- 0
- 240
-
【AE脚本案例】随机产生关键帧
[sc name="zhuanzai" author="Zack Lovatt" link="https://github.com/zlovatt/zl_Scriptlets" ][/sc] 介绍 关键帧的各种设置,是个不错的案例 说明 以下案例来自aereference.com 源码 /** * Takes a pair of keyframes and adds extra randomly stumbling, staggering keyframes between them. * * Helpful for making realistic progress bars, and probably not much else! * * Known Issues: * - Sometimes, Bezier keyframes overshoot a lot causing reverse animation * - The same speed/influence easing is used for all dimensions of a keyfrrame * * @author Zack Lovatt <zack@zacklovatt.com> * @version 0.1.3 */ (function keyStumbler(thisObj) { var NUM_KEYS = 20; var MIN_GAP_FRAMES = 2; // The chance to have certain types of animation (out of 100) var HOLD_CHANCE_PERCENT = 5; var BEZIER_CHANCE_PERCENT = 50; // Only if IN and OUT are both bezier will these come into play: var AUTOBEZIER_CHANCE_PERCENT = 33; var CONTINUOUS_CHANCE_PERCENT = 33; /** * Draws UI * * @returns {Window} Created window */ function createUI() { var win = thisObj instanceof Panel ? thisObj : new Window("palette", "Key Stumbler", undefined, { resizeable: true, }); win.alignChildren = ["fill", "top"]; win.minimumSize = [50, 80]; var pnlOptions = win.add("panel", undefined, "Options"); pnlOptions.alignChildren = ["left", "top"]; var grpNumKeys = pnlOptions.add("group"); grpNumKeys.alignment = ["fill", "fill"]; grpNumKeys.alignChildren = ["fill", "top"]; var stNumKeys = grpNumKeys.add( "statictext", undefined,…- 0
- 0
- 206
-
【PR脚本】示例:移动后面剪辑到前面的末尾
本来想用clip.start。表面上可以读写,但是会报错!! 所以要用try,这样会生效,再忽视错误即可 以下脚本为:移动视频第2轨的 第2个剪辑片段 对齐到 第1个剪辑片段的后面 // Move Next Clip To Previous End var sequence = app.project.activeSequence; // active sequence var clip1 = sequence.videoTracks[1].clips[0] // first clip var clip2 = sequence.videoTracks[1].clips[1] // second clip var new_end_time = clip2.end.seconds - clip2.start.seconds + clip1.end.seconds // second clip new end time , this way, dont change the clip duration // use "clip.start" or "clip.end" will throw an error. I dont know why. try { clip2.start = clip1.end.seconds } catch (error) { try { clip2.end = new_end_time } catch (error) { } }- 0
- 0
- 316
-
【AE脚本】创建齿轮
介绍 创建齿轮 来源 https://www.motionboutique.com/gear-script/ 其他说明 图片默认被关了 115~124行。需要的自行下载图片,并放在脚本同级目录的(CreateGear_Resources) 里 源码 /* CreateGear.jsx version: 1.0 author: Charles Bordenave (www.motionboutique.com) date: 31 Aug 2013 credit: thanks to Jongware who wrote the original version of this script for AI (see http://forums.adobe.com/thread/738063) download:https://www.motionboutique.com/gear-script/ */ function CreateGear() { var createGear = this; var utils = new CreateGearUtils(); // infos this.scriptName = "CreateGear"; this.scriptVersion = "1.0"; this.scriptTitle = "Create Gear"; this.scriptCopyright = "Copyright (c) 2013 Motion Boutique"; this.scriptHomepage = "http://www.motionboutique.com"; this.scriptDescription = { en: "This script creates a gear with a shape layer.", fr: "Ce script crée une roue dentée avec un calque de forme." }; this.scriptAbout = { en: this.scriptName + ", v" + this.scriptVersion + "\\r" + this.scriptCopyright + "\\r" + this.scriptHomepage + "\\r\\r" + utils.loc(this.scriptDescription), fr: this.scriptName + ", v" + this.scriptVersion + "\\r" + this.scriptCopyright + "\\r" + this.scriptHomepage + "\\r\\r" + utils.loc(this.scriptDescription) }; this.scriptUsage = { en: "\u25BA Activate a composition \\r" + "\u25BA Specify gear settings \\r" + "\u25BA Click on Create", fr: "\u25BA Activez une composition \\r" + "\u25BA Spécifiez les paramètres de la roue dentée \\r" + "\u25BA Cliquez sur Créer" }; // UI strings and default values this.aboutBtnName = "?"; this.gearSizeStName = { en: "Gear Size:", fr: "Taille…- 0
- 0
- 167
-
【AE脚本开发】给脚本写个联网激活机制
/* 激活流程: 1.用户填写授权码; 2.利用授权码与机器码生成网页链接; 3.脚本调用curl程序访问链接。如果授权码有效,得到服务器通过机器码计算出来的激活码;否则得到服务器返回的授权码不可用。 4.将激活码存于本地。 说明:重装系统等原因导致本地激活码丢失,电脑需要再次激活时,只需联网验证机器码即可,无需再次填授权码。这个步骤自己扩展,这里写首次激活的示例。 */ //打开注册面板 function zhuCe(){ if(pc.pcJQM.length == 0 && (!isMac ())){ alert ("请先启用已禁用的网卡!\n然后关闭脚本重新打开。","无法验证激活状态!"); system.callSystem("cmd.exe /c ncpa.cpl"); return; } var zhuCeW = new Window("dialog", "注册"); var res = "group {\ orientation:'column', alignment:['fill','fill'],preferredSize:[0,0] \ GG: Group { \ orientation:'row', alignment:['fill','fill'],preferredSize:[0,0] \ }, \ fen: Panel { alignment:['fill','top'],preferredSize:[300,2] }, \ GG2: Group{\ orientation:'column', alignment:['fill','fill'],preferredSize:[0,0] \ t1 : Group { alignment:['fill','center']\ text: StaticText { text:'注册码:', alignment:['left','center'] }, \ passText: EditText { text:'', characters:20, alignment:['fill','center'] }, \ },\ btn: Group { \ orientation:'row', alignment:['fill','fill'],preferredSize:[0,0] \ zhuCe: Button { text:'注册', alignment:['right','center'],preferredSize:[150,30] }, \ gouMai: Button { text:'去淘宝购买注册码', alignment:['left','center'],preferredSize:[150,30] }, \ }, \ },\ }"; zhuCeW.gr = zhuCeW.add(res); //注册 zhuCeW.gr.GG2.btn.zhuCe.onClick = function(){ var sma = zhuCeW.gr.GG2.t1.passText.text.replace (/\W/g, ""); //app.settings.saveSetting(Hound.name,"sma" , strToUrl (sma)); if(pc.pcJQM.length == 0){alert("识别主板失败!\n请先启用以太网卡(win7:本地连接)。")} if(sma.length == 30){ if(web_jihuo (sma, pc.pcJQM.toString ().replace (/,/g, ''))){alert("注册成功!");zhuCeW.close ()} } else{alert("注册码输入有误!")} } //去淘宝购买注册码 //zhuCeW.gr.GG2.btn.gouMai.onClick = function(){ openURL(url.taobao) ;zhuCeW.close();}; zhuCeW.show(); } //获取机器码 function getPcMac(){ if(isMac ()){ var macId = system.callSystem("ifconfig en0 | awk '/ether/{print $2}'"); macId = macId.substr(0,17); if(macId.substr (0, 8) !=="ifconfig"){ pc.pcJQM.push (mac2jqm (macId)); } var patt = new RegExp(/[0-9A-F]{2}:[0-9A-F]{2}:[0-9A-F]{2}:[0-9A-F]{2}:[0-9A-F]{2}:[0-9A-F]{2}/ig); var s , j; macId = system.callSystem("ifconfig"); while((s = patt.exec(macId)) != null){ j = s.toString().replace (/\:/g, "").replace(/\s/g,""); if(pc.pcJQM.toString ().indexOf (j) == -1 && pc.pcJQM.length <…- 0
- 0
- 630
-
【AE脚本】翻译小助手 | 一键获取效果所有属性
使用前 记得打开 编辑-> 首选项 -> 脚本与表达式 -> 允许脚本访问网络与文件读写 更新 0.0.3 修复了下,少var了一个变量。 使用方法 把文件放在AE脚本路径的UI Panel 文件夹里。 运行ae 选择一个图层,点击“翻译”按钮,将获取图层中的效果的所有参数,并保存到桌面文件(AE translattion xxx.txt)。 后续做笔记啊 弄中英对照都会方便很多 源码 /* 名称:翻译小助手 * 版本号:0.0.2 * 说明:选择一个图层,点击“翻译”按钮,将获取图层中的效果的所有参数,并保存到桌面。 * 源码:https://www.yuelili.com/?p=21499 */ var panelGlobal = this; var dialog = (function () { // UI开始 var dialog = (panelGlobal instanceof Panel) ? panelGlobal : new Window("palette"); if (!(panelGlobal instanceof Panel)) dialog.text = "翻译小助手0.0.1"; dialog.orientation = "column"; dialog.alignChildren = ["center", "top"]; dialog.spacing = 10; dialog.margins = 16; var btn = dialog.add("button", undefined, undefined, { name: "btn" }); btn.helpTip = "选择要翻译的图层"; btn.text = "开始获取属性名称"; btn.onClick = myFunction; // 函数功能区 var res = "" File.prototype.write_file = File.prototype.write_file || function (data) { this.open('w', undefined, undefined); this.encoding = "UTF-8"; this.write(data); this.close(); } function property_recursive(propertyGroup) { for (var i = 1; i <= propertyGroup.numProperties; i++) { var property = propertyGroup.property(i); if (property instanceof PropertyGroup) { property_recursive(property); res += "----\n\n" continue; } res += property.name + "\n"; } } function effect_recursive(layer) { var eff = layer.property("ADBE Effect Parade"); for (var i = 1, l = eff.numProperties; i <= l; i++) { res += "-------" + eff(i).name + "| Start-------\n" property_recursive(eff(i)) // 对每个效果进行操作 res += "-------" + eff(i).name + "| End-------\n" } } function get_format_time() { var nowDate =…- 0
- 0
- 1.2k
-
[AE脚本]使用可执行文件给脚本源码加密
ae脚本源码基本上就是jsx 或者jsxbin, 但是现在很多破解工具, 源码基本上裸奔... 可以通过ae脚本执行exe文件, 其中源码包含在exe文件内部, 再通过exe与ae通信执行脚本, 可以一定程度提高脚本破解难度 大致流程 AE->运行脚本->调用exe->执行真正脚本内容->发送给ae 其中调用exe可以使用cnd直接调用 exe发送给ae 可以使用 cmd AfterFX-脚本- 0
- 0
- 46
-
-
【AE脚本开发】验证系统 | 在线
本地验证(略) 在线验证 1.根据账号密码、机器码获取信息 https://www.yuelili.com/api/user/get_produt_auth/?username=用户名&password=密码&product=文章ID&mac=MAC码 成功返回 {"status":"ok","cookie":"COOKIE信息","user":{"id":1,"username":"yueli","pay_status":1,"product_info":"可在文章内页设置';","mac":"1" 失败返回 {"status":"error","error":"not paid"} 2.根据订单号获取信息 https://www.yuelili.com/api/user/get_order/?order_id=订单号&product=文章ID 判断依据:pay_status 成功返回: {"status":"ok","pay_status":1,"id":"1","order_price":"0.01","create_time":"1638093503"} 失败返回: {"status":"ok","pay_status":0,"id":null,"order_price":null,"create_time":null} 使用方法 var response = system.callSystem('curl -G -d "username=用户名" -d "password=密码" -d "product=文章ID" -d "mac=机器码" https://www.yuelili.com/api/user/get_produt_auth/'); alert(response ) 然后你在截取需要信息即可 var envatoResponse = system.callSystem('curl -G -d "order_id=订单号" -d "product=文章ID" https://www.yuelili.com/api/user/get_order/'); 其他 1.如何获取文章ID 单击文章有个小链接并粘贴:https://www.yuelili.com/?p=20251 。这个20251就是文章ID 2.如何加入自定义信息 文章创建页面,有个自定义字段,然后拉到最下面。新建:product_info,再输入你的信息,就可以在接口中获取了- 0
- 0
- 309
-
【AE脚本】无限制视图缩放
描述 AE自带的缩放除了自适应,只有33%,50%,100%。想取中间值非常费劲 源码 //视图无级缩放 v1.0.0 2021-08-06 //Raymond Yan 2021 (RaymondClr@outlook.com / QQ: 1107677019) var win = new Window( "palette { margins: 5, spacing: 5, orientation: 'row', \ A: Button { size: [25, 25] text: '小' }, \ B: Slider { size: [150, 25], minvalue: 1, maxvalue: 100 }, \ C: Button { size: [25, 25] text: '大' },\ }" ); win.show(); var btn_zoomIn = win.A; var sld_zoomRatio = win.B; var btn_zoomOut = win.C; var g_zoomScaleStep = 5; var g_magnification = 50; (function initViewZoom() { var zoomScale = app.activeViewer ? app.activeViewer.views['0'].options.zoom : g_magnification / 100; g_magnification = sld_zoomRatio.value = zoomScale > 1 ? 100 : zoomScale * 100; })(); btn_zoomIn.onClick = zoomCompView(0, sld_zoomRatio, g_zoomScaleStep); btn_zoomOut.onClick = zoomCompView(1, sld_zoomRatio, g_zoomScaleStep); sld_zoomRatio.onChange = sld_zoomRatio.onChanging = zoomCompView(2, sld_zoomRatio); function zoomCompView(modeIndex, scriptUiSliderControl, step) { var zoomStrategies = [ function (value, step) { var scale = Math.ceil(Math.ceil(value) / step) * step - step; return scale < 1 ? 1 : scale; }, function (value, step) { var scale = Math.floor(Math.floor(value) / step) * step + step; return scale > 100 ? 100 : scale; }, function (value) { return Math.floor(value * 100) / 100; }, ][modeIndex]; return function () { if (!app.activeViewer) return (scriptUiSliderControl.value = g_magnification);…- 0
- 0
- 400
-
【脚本问答】怎么给脚本加注册码 | 加密 验证
/@草哥 只说关键几步,具体需要自己写 //1.获取电脑的mac地址 //苹果机 var info=system.callSystem("ifconfig"); var patt = /[0-9A-Z]{2}:[0-9A-Z]{2}:[0-9A-Z]{2}:[0-9A-Z]{2}:[0-9A-Z]{2}:[0-9A-Z]{2}/ig; info = patt.exec(info); newMacArr = info[0].replace (/[:]/g, ""); //PC机 var info=system.callSystem("wmic nicconfig get macaddress"); var patt = /[0-9A-Z]{2}:[0-9A-Z]{2}:[0-9A-Z]{2}:[0-9A-Z]{2}:[0-9A-Z]{2}:[0-9A-Z]{2}/ig; info = patt.exec(info); newMacArr = info[0].replace (/[:]/g, ""); // 2.对mac地址加密,变成注册码 //自己随便编个算法 var macAddress; var output=(macAddress*123/36+2-19)*3.14;//类似于这样 // 3.对比脚本算出来的和输入框里面的注册码是不是一样,一样的话脚本按钮才起作用 var code = "ef783vg3999bhs6" if(output === code){alert("Do something!")} // 4.如何把用户输入的注册码存起来? //看看getSetting()方法和saveSetting()方法- 0
- 0
- 262
-
【AE脚本开发】必学!UI:一个按钮,单击执行功能
只要把你的函数放在函数区,然后单击按钮,就可以执行你的函数啦 比如我是单击按钮,alert一段文字。 你也可以把写好的脚本放在ae安装目录\Support Files\Scripts\ScriptUI Panels下,这样就可以停靠了。记得重启ae再打开 代码 /** * 作者:yueli * 源码:https://www.yuelili.com/?p=19664 */ var panelGlobal = this; var palette = (function () { // UI 构建 // ======= var palette = (panelGlobal instanceof Panel) ? panelGlobal : new Window("palette"); if (!(panelGlobal instanceof Panel)) palette.text = "窗口名称"; palette.orientation = "row"; palette.alignChildren = ["center", "top"]; palette.spacing = 10; palette.margins = 16; var create = palette.add("button", undefined, undefined, { name: "create" }); create.helpTip = "提示文字"; create.text = "按钮名称"; create.preferredSize.width = 80; // 按钮长度 create.onClick = create_it // 绑定函数 // 主函数功能区 function create_it() { // 写你的功能 alert("hello world") } // UI 结束区(展示) palette.layout.layout(true); palette.layout.resize(); palette.onResizing = palette.onResize = function () { this.layout.resize(); } if (palette instanceof Window) palette.show(); return palette; }());- 0
- 0
- 667
-
[AE脚本开发]ScriptUI点击控件创建新按钮并绑定事件
// ScriptUI点击控件创建新按钮并绑定事件 v1.0.0 2022-02-06 // Raymond Yan 2022 (RaymondClr@outlook.com / QQ: 1107677019) var mainWindow = new Window("palette", "主界面"); var button = mainWindow.add("button", undefined, "添加按钮"); var count = 1; button.onClick = function () { var newButton = mainWindow.add("button", undefined, "按钮" + count++); newButton.onClick = function () { alert(this.text); }; mainWindow.layout.layout(true); }; mainWindow.show();- 0
- 0
- 231
-
【PR脚本】添加到AME渲染
来源 NT油管教程 知识点 1.文件路径要用/或者\ 2.渲染参数中的文件要用字符串 3.可以先判断文件是否存在,file.exists 4.AME的预设文件在C:\Users\你的用户名\Documents\Adobe\Adobe Media Encoder\14.0\Presets\ 里 源码 var sequence = app.project.activeSequence; // 活动序列 app.encoder.launchEncoder(); // 启动AME // var video = File("C:\\Users\\YL\\Desktop\\test.mp4") // var preset = File("C:\\Users\\YL\\Documents\\Adobe\\Adobe Media Encoder\\14.0\\Presets\\IG.epr") // 添加文件到渲染队列 // app.encoder.encodeFile(video.fsNmae, preset.fsNmae, 0, true); // 添加系列到渲染队列 app.encoder.encodeSequence(sequence, "C:\\Users\\YL\\Desktop\\test.mp4", "C:\\Users\\YL\\Documents\\Adobe\\Adobe Media Encoder\\14.0\\Presets\\MY Preset.epr", 0, true); app.encoder.startBatch(); // 开始渲染- 0
- 0
- 363
-
[AE脚本开发]ScriptUI实现输入提示(类网页搜索框)
// ScriptUI实现输入提示 v1.0.0 2022-02-19 // Raymond Yan 2022 (RaymondClr@outlook.com / QQ: 1107677019) var mainWindow = new Window("palette", "主界面"); var inputTips = "请输入内容"; var inputControl = mainWindow.add("edittext", [0, 0, 100, 25], inputTips); inputControl.onActivate = function () { if (this.textCache === inputTips) return; if (this.text === inputTips) this.text = ""; }; inputControl.addEventListener("blur", function () { this.textCache = this.text; if (this.text === "") this.text = inputTips; }); mainWindow.show();- 0
- 0
- 173
-
【AE脚本】照片墙 IMAGES WALL | 免费
来源 https://www.motionboutique.com 用法 在项目面板中选择一个文件夹。 执行脚本并调整参数(#rows、#cols、transition)。 单击创建。 源码 太长,见下载链接- 0
- 1
- 438
-
ColorPicker颜色选取器
//////////////////////////////////////////////////////////////////////////// // ADOBE SYSTEMS INCORPORATED // Copyright 2007 Adobe Systems Incorporated // All Rights Reserved // // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance with the // terms of the Adobe license agreement accompanying it. If you have received this file from a // source other than Adobe, then your use, modification, or distribution of it requires the prior // written permission of Adobe. ///////////////////////////////////////////////////////////////////////////// /** @fileoverview Shows how to use graphic objects to customize the drawing of ScriptUI elements. @class Shows how to use graphic objects to customize the drawing of ScriptUI elements. <h4>Usage</h4> <ol> <li>Open this file and run it in the ExtendScript Toolkit. You can choose as the target any application that supports ScriptUI</li> <li>Move the sliders up and down to change the color of the panels</li> <li>Click the large swatch to pop an alert with the current RGB settings</li> </ol> <h4>Description</h4> This script creates an example Color Picker floating palette to show how to use some of the ScriptUI graphics properties and methods. Specifically, it demonstrates: <ul> <li>Defining a ScriptUIFont object and using it to set an element's graphics.font property.</li> <li>Defining a ScriptUIBrush object and using it to set an…- 0
- 0
- 257
-
【AE脚本】相册样式排列 | 免费
介绍 创建齿轮 来源 https://www.motionboutique.com 用法 选择一些图层。 单击创建。(可选,指定每个图层周围的边框,并决定合成尺寸是否应与拼贴尺寸匹配。)- 0
- 0
- 306
-
[AE脚本] 储存效果/图层样式 等等
使用方法 只需将storeStyleLayer 传入顶级需要保存的属性组名称即可, 因为原本只想储存图层样式的, 懒得改函数名了 typescript版本 import { activeLayer } from 'base/variables'; class PropertyItem { script: string; constructor(prop: Property, parent: PropertyCollection) { let tmpScript = ''; const propertyMatchName = prop.matchName; const propertyValue = prop.value; const propertyString = parent.name + '.property("' + propertyMatchName + '")'; // 储存值 if (prop.expressionEnabled) { try { const expressionValue = prop.expression; tmpScript += propertyString + '.expression="' + expressionValue + '";\n'; tmpScript += propertyString + '.expressionEnabled=true;\n'; } catch (error) {} } else { // 没有表达式 直接复制值 tmpScript += propertyString + '.setValue(' + propertyValue + ');\n'; } // TODO 储存关键帧 if (prop.numKeys > 0) { } this.script = tmpScript; } parse(): string { return this.script; } } class PropertyCollection { name: string = ''; // 当前层级属性的脚本名称 props: (PropertyItem | PropertyCollection)[] = []; // 储存的属性与属性组 constructor(name: string) { this.name = name; } parse(): string { let tmpScript = ''; for (const prop of this.props) { tmpScript += prop.parse(); } return tmpScript; } add(prop: PropertyItem | PropertyCollection) { this.props.push(prop); } } function storeStyleLayer(layer: Layer, groupName = 'ADBE Layer Styles') { const styles = layer.property(groupName); const rootPropertyCollection = new PropertyCollection(`.property('${groupName}')`); loopPropertyClass(styles, rootPropertyCollection); let tmpScript = rootPropertyCollection.parse(); alert(tmpScript); } function loopPropertyClass(px: _PropertyClasses, parent: PropertyCollection) { // 判断是不是属性 if (px.propertyType === PropertyType.PROPERTY) {…- 0
- 0
- 101
-
【AE脚本开发】调用ae自带颜色拾取
Github link=https://github.com/Belonit/AEColorPicker 方法一 外部插件 安装 Windows: 将 AEColorPicker.aex 复制到文件夹 Adobe After Effects 安装目录\Support Files\Plug-ins Mac: 将 AEColorPicker.plugin 复制到文件夹 Applications/Adobe After Effects [version]/Plug-ins 调用 var externalLibrary = new ExternalObject('lib:C:\\AEColorPicker.aex'); var oldColor = 0x20F186; var newColor = externalLibrary.colorPicker(oldColor, dialog_title); if(newColor == -1){ //Returns -1 if user clicked on cancel newColor = oldColor; } 方法二 脚本生成 或者你可以通过一些小技巧使用脚本完成 // https://community.adobe.com/t5/after-effects-discussions/calling-the-after-effects-color-picker-through-script/td-p/11954317 function ColorPicker(startValue) { // find the active comp var crntComp = app.project.activeItem; if (!crntComp || !(crntComp instanceof CompItem)) { alert('Please open a comp first'); return []; } // add a temp null; var newNull = crntComp.layers.addNull(); var newColorControl = newNull('ADBE Effect Parade').addProperty('ADBE Color Control'); var theColorProp = newColorControl('ADBE Color Control-0001'); // set the value given by the function arguments if (startValue && startValue.length == 3) { theColorProp.setValue(startValue); } // prepare to execute var editValueID = 2240; // or app.findMenuCommandId("Edit Value..."); theColorProp.selected = true; app.executeCommand(editValueID); // harvest the result var result = theColorProp.value; // remove the null if (newNull) { newNull.remove(); } return result; } alert(ColorPicker([1, 1, 1]));- 0
- 0
- 530
-
【AE脚本开发】颜色转换
[sc name="zhuanzai" author="jonathantneal" link="https://github.com/jonathantneal/convert-colors/tree/master/src" ][/sc] HEX and RGB @无名 正则hex转rgb function hexToRgb(hex) { var result; hex = hex.replace(/^#?([a-f\d])([a-f\d])([a-f\d])$/gi, '$1$1$2$2$3$3'); hex.replace(/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/gi, function (match, $1, $2, $3) { result = [parseInt($1, 16), parseInt($2, 16), parseInt($3, 16)]; }); return result; } function hex2rgb(hex) { // #<hex-color>{3,4,6,8} const hexColorMatch = /^#?(?:([a-f0-9])([a-f0-9])([a-f0-9])([a-f0-9])?|([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})([a-f0-9]{2})?)$/i; const [, r, g, b, a, rr, gg, bb, aa] = hex.match(hexColorMatch) || []; if (rr !== undefined || r !== undefined) { const red = rr !== undefined ? parseInt(rr, 16) : parseInt(r + r, 16); const green = gg !== undefined ? parseInt(gg, 16) : parseInt(g + g, 16); const blue = bb !== undefined ? parseInt(bb, 16) : parseInt(b + b, 16); const alpha = aa !== undefined ? parseInt(aa, 16) : a !== undefined ? parseInt(a + a, 16) : 255; return [red, green, blue, alpha].map(c => c * 100 / 255); } return undefined; } export function rgb2hex(rgbR, rgbG, rgbB) { return `#${((1 << 24) + (Math.round(rgbR * 255 / 100) << 16) + (Math.round(rgbG * 255 / 100) << 8) + Math.round(rgbB * 255 / 100)).toString(16).slice(1)}`; } HSL and hsv function hsl2hsv(hslH, hslS, hslL) { const hsv1 = hslS * (hslL < 50 ? hslL…- 0
- 0
- 672
-
【AE脚本案例】洋葱皮
介绍 skins:之前/之后的洋葱皮数量。4将在之前和之后创建4个皮肤。 opacity:起始不透明度,每个洋葱皮的不透明度逐渐降低。 skin every x freames:皮肤每X帧是皮肤之间交错的帧数。 make:制作洋葱皮 remove:移除洋葱皮 refresh:更新设置 单击一个图层,使用本脚本即可 这个帖子来自一个帖子早期前保罗·塔斯利上www.aenhancers.com,非常感谢您的帖子。 其他 来源:https://github.com/scottjwood/AE_OnionSkinBuddy 源码 // https://github.com/scottjwood/AE_OnionSkinBuddy { function scottPanel(thisObj) { var onionArray = []; // array to hold created layers var frameTime = .04; // float for a single frame var skinInput; // how many skins on each side var opacityInput; // starting opacity for skins var skinFrameInput; // stagger skins every x frames var onionBefore = true; var onionAfter = true; var colorBefore = [0, .93, .99]; // blue var colorAfter = [.98, 0, .99]; // purple function scottPanel_buildUI(thisObj) { var onionSkinnerPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette", "Onion Skin Buddy", [100, 100, 300, 280]);// // add buttons var skinText = onionSkinnerPanel.add("statictext", [10,10,110,30], "# of skins"); skinInput = onionSkinnerPanel.add("edittext", [70,10,110,30], "4"); var opacityText = onionSkinnerPanel.add("statictext", [10,40,110,60], "Opacity of skins"); opacityInput = onionSkinnerPanel.add("edittext", [100,40,130,60], "50"); var skinFrameText = onionSkinnerPanel.add("statictext", [10,65,110,85], "Skin every x frames"); skinFrameInput = onionSkinnerPanel.add("edittext", [120,65,150,85], "2"); var buttonMakeOnion = onionSkinnerPanel.add("button", [10,90,180,110], "Make Onion"); var buttonRemoveOnion = onionSkinnerPanel.add("button", [10,115,180,135], "Remove Onions"); var buttonRefreshOnion = onionSkinnerPanel.add("button", [10,140,180,160], "Refresh Onions"); buttonMakeOnion.onClick = makeOnionSkin; buttonRemoveOnion.onClick = removeOnionSkin; buttonRefreshOnion.onClick = refreshOnionSkin; return onionSkinnerPanel; } // End of panel creation function makeOnionSkin() { var activeItem = app.project.activeItem; // make…- 0
- 0
- 417