```
/*
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內容替換字幕腳本