-
Notifications
You must be signed in to change notification settings - Fork 22
/
Toggle Temporal Continuous.jsx
45 lines (35 loc) · 1.03 KB
/
Toggle Temporal Continuous.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
/**
* Enables temporal continuous status on selected keyframes
*
* Modifiers:
* - Hold SHIFT to DISABLE temporal continuous
*
* @author Zack Lovatt <[email protected]>
* @version 0.2.2
*/
(function toggleTemporalContinuous() {
var enable = !ScriptUI.environment.keyboardState.shiftKey;
var comp = app.project.activeItem;
if (!(comp && comp instanceof CompItem)) {
alert("Please select a composition!");
return;
}
var layers = comp.selectedLayers;
app.beginUndoGroup('Toggle Temporal Continuous');
for (var ii = 0, il = layers.length; ii < il; ii++) {
var layer = layers[ii];
var props = layer.selectedProperties;
for (var jj = 0, jl = props.length; jj < jl; jj++) {
var prop = props[jj];
if (prop instanceof PropertyGroup) {
continue;
}
var keys = prop.selectedKeys;
for (var kk = 0, kl = keys.length; kk < kl; kk++) {
var selectedKeyIndex = keys[kk];
prop.setTemporalContinuousAtKey(selectedKeyIndex, enable);
}
}
}
app.endUndoGroup();
})();