forked from kyletmartinez/after-effects-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Set Selected Layer Track Matte To Layer Above It.jsx
28 lines (27 loc) · 1.06 KB
/
Set Selected Layer Track Matte To Layer Above It.jsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/**
* @title Set Selected Layer Track Matte To Layer Above It
* @version 1.0
* @author Kyle Martinez <www.kyle-martinez.com>
*
* @description Set the track matte for all selected layers to the layer above it. Currently uses
* a Luma Inverted track matte type.
*
* @license This script is provided "as is," without warranty of any kind, expressed or implied. In
* no event shall the author be held liable for any damages arising in any way from the use of this
* script.
*
* In other words, I'm just trying to help make life as an animator easier
* "A rising tide lifts all boats." - John F. Kennedy, 1963
*/
(function() {
app.beginUndoGroup("Set Selected Layer Track Matte To Layer Above It");
var comp = app.project.activeItem;
var layers = comp.layers;
var selectedLayers = comp.selectedLayers;
var numSelectedLayers = selectedLayers.length;
for (var l = 0; l < numSelectedLayers; l++) {
var layer = selectedLayers[l];
layer.setTrackMatte(layers[layer.index - 1], TrackMatteType.LUMA_INVERTED);
}
app.endUndoGroup();
})()