```
/*
Light_for_Selected_Plane.jsx
Version 1
After Effects JavaScript by Christopher R. Green
(the guy who runs crgreen.com)
Places a light in comp pointed at selected layer
展翅鹰汉化
*/
var activeItem = app.project.activeItem;
if ( (activeItem == null) || !(activeItem instanceof CompItem) ) {
} else {
var selectedLayers = activeItem.selectedLayers;
var selNum = activeItem.selectedLayers.length;
if (!(selNum == 1)) {
if (selNum == 0) {selNum = "No"}
alert(selNum + " 个层被选择了. 请只选择一个层.");
} else {
mainPlane = selectedLayers[0];
origMainPlane = null;
planesParent=mainPlane.parent;
if (!mainPlane.threeDLayer) {
alert("这不是一个3D 图层.");
}else{
planeName = mainPlane.name;
///////////////////////////////////////////////////////
app.beginUndoGroup("Place Light");
if (planesParent != null) {
// swicheroo
origMainPlane = mainPlane;
mainPlane = ( mainPlane.duplicate() );
// 'bake' parented values:
mainPlane.parent = null;
}
timeNow = mainPlane.time;
startPos = mainPlane.position.valueAtTime(timeNow, false);
ori=mainPlane.property("orientation").valueAtTime(timeNow, false);
rots=[mainPlane.property("X Rotation").valueAtTime(timeNow, false), mainPlane.property("Y Rotation").valueAtTime(timeNow, false), mainPlane.property("Z Rotation").valueAtTime(timeNow, false)];
// there is undoubtedly a formula to calculate the best distance, but for now, do rough back-off ...
scFctrX=mainPlane.property("Scale").valueAtTime(timeNow, false)[0]*.01;
scFctrY=mainPlane.property("Scale").valueAtTime(timeNow, false)[1]*.01;
// based on size (scale factored in) of plane
zAdj=( (mainPlane.width*scFctrX)+(mainPlane.height*scFctrY) )/2;
if (planesParent != null) {
// switcheroo backeroo
doomedLayer = mainPlane;
mainPlane=origMainPlane;
doomedLayer.remove();
}
///////////////////////////////////////////////////////
newName=(planeName.substr(0,25));//truncate for new object's name
newLight=activeItem.layers.addLight((newName + "_light"), [activeItem.width/2, activeItem.height/2]);
newLight.autoOrient = AutoOrientType.NO_AUTO_ORIENT;
// light gets positioned at plane's point in space, but backed off a bit in z
newLight.property("position").setValue([startPos[0], startPos[1], (startPos[2]-zAdj)]);
tempNull = activeItem.layers.addNull();
tempNull.threeDLayer=true;
// i don't think this makes any diff, but it's aesthetically pleasing to me (i'm insane)
tempNull.property("Anchor Point").setValue([50, 50, 0]);
// tempNull is placed at plane's point in space
tempNull.property("position").setValue(startPos);
// make tempNull light's parent
newLight.parent = tempNull;
// shake
// rotate tempNull so that light is oriented correctly
tempNull.property("orientation").setValue(ori);
tempNull.property("X Rotation").setValue(rots[0]);
tempNull.property("Y Rotation").setValue(rots[1]);
tempNull.property("Z Rotation").setValue(rots[2]);
// and bake
doomedNullSrc=tempNull.source;
//note: must delete layer first, then source in order to 'bake' parented values (cannot just remove source)
newLight.parent=null;
tempNull.remove();
doomedNullSrc.remove();
newLight.moveBefore(mainPlane);
newLight.selected = true;
app.endUndoGroup();
///////////////////////////////////////////////////////
}
}
}
```
- 脚本管理器
- 读取文件夹内文件
- 层层时间线偏移Sequencer.jsx
- 层层随机时间偏移
- 文字分离char_separate_1.3
- 分解文字 把一个文字层分成若干个文字层
- 快速导入Smart Import
- 查找与替换字符 Find and Replace Text.jsx
- 层改名Selected_Layers_Renamer.jsx
- 创建灯光为选择的三维层.jsx
- 创建摄像机为选择的三维图层.jsx
- 创建调节图层CreateTrimmedAdjustmentLayer.jsx
- 创建调节图层多个CreateSeveralTrimmedAdjustmentLayers.jsx
- 创建一个空物体到选择的层Add Parented Null to Selected Layers.jsx
- 文字分离DecomposeText
- 修改渲染输出文件位置Change Render Locations
- AE脚本读取txt文档并写入数组
- AE脚本把数组写入到txt文档中
- AE提取字幕脚本
- AE批量用txt内容替换字幕脚本