-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathSet Track Matte To Above.jsx
31 lines (30 loc) · 1.03 KB
/
Set Track Matte To Above.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
29
30
31
/**
* @name Set Track Matte To Above
* @version 2.1
* @author Kyle Martinez <www.kyle-martinez.com>
*
* @description Set the track matte for all selected layers to the layer above it.
*
* * "TrackMatteType.ALPHA"
* * "TrackMatteType.ALPHA_INVERTED"
* * "TrackMatteType.LUMA"
* * "TrackMatteType.LUMA_INVERTED"
* * "TrackMatteType.NO_TRACK_MATTE"
*
* @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.
*
* I'm just trying to help make life as an After Effects animator a little easier.
*/
(function setTrackMatteToAbove() {
app.beginUndoGroup("Set Track Matte To Above");
var comp = app.project.activeItem;
var layers = comp.selectedLayers;
var numLayers = layers.length;
for (var l = 0; l < numLayers; l++) {
var layer = layers[l];
layer.setTrackMatte(comp.layers[layer.index - 1], TrackMatteType.LUMA_INVERTED);
}
app.endUndoGroup();
})();