-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathStick_Effect_to_Layer.jsx
28 lines (27 loc) · 1015 Bytes
/
Stick_Effect_to_Layer.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
/**
* @name Stick Effect To Layer
* @version 2.2
* @author Kyle Martinez <www.kyle-martinez.com>
*
* @description Help effects with position properties such as "CC Bend It" or "Gradient Ramp" stick
* properly to a layer.
*
* @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 stickEffectToLayer() {
app.beginUndoGroup("Stick Effect To Layer");
var comp = app.project.activeItem;
var properties = comp.selectedProperties;
var numProperties = properties.length;
for (var p = 0; p < numProperties; p++) {
var property = properties[p];
if (property.propertyValueType === PropertyValueType.TwoD_SPATIAL) {
property.expression = "toComp(anchorPoint + value);";
}
}
app.endUndoGroup();
})();