-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathremoveSmooth.jsx
64 lines (39 loc) · 1.19 KB
/
removeSmooth.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
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
(function() {
app.beginUndoGroup("remove smoothing");
if (!Array.prototype.indexOf) {
Array.prototype.indexOf = function(elt /*, from*/) {
var len = this.length >>> 0;
var from = Number(arguments[1]) || 0;
from = (from < 0) ? Math.ceil(from) : Math.floor(from);
if (from < 0) {
from += len;
}
for (; from < len; from++) {
if (from in this && this[from] === elt) {
return from;
}
}
return -1;
};
}
var myComp = app.project.activeItem;
if (!myComp || !(myComp instanceof CompItem)) {
return;
}
var myLayers = myComp.selectedLayers;
var effectsToRemove = ["OLM Smoother", "PSOFT ANTI-ALIASING"];
function removeEffects(myLayer, effectNames) {
var myEffects = myLayer.property("ADBE Effect Parade");
if (!myEffects) return;
for (var i = myEffects.numProperties; i > 0; i--) {
var myEffect = myEffects.property(i);
if (effectNames.indexOf(myEffect.matchName) !== -1) {
myEffect.remove();
}
}
}
for (var i = 0; i < myLayers.length; i++) {
removeEffects(myLayers[i], effectsToRemove);
}
app.endUndoGroup();
})();