Skip to content

Commit fee1e5e

Browse files
author
Nik Ska
committed
some small updates
1 parent 00d99e1 commit fee1e5e

File tree

3 files changed

+38
-57
lines changed

3 files changed

+38
-57
lines changed

newTrimmedNull.jsx

+1-27
Original file line numberDiff line numberDiff line change
@@ -1,27 +1 @@
1-
//Snippet for new trimmed null creation
2-
//creates a null trimmed to the highest selected layer
3-
//inherits its color
4-
//CC-BY-SA Nik Ska, 2013
5-
6-
var newNull = {}
7-
8-
newNull.go = function(){
9-
var activeComp = app.project.activeItem; //active item
10-
if(activeComp && activeComp instanceof CompItem){ //if it's a comp
11-
var sel = activeComp.selectedLayers; //selected layers
12-
app.beginUndoGroup("Create smart null"); //Undo
13-
var nullLayer = activeComp.layers.addNull(); //adding Null
14-
if(sel){ //if anything is selected
15-
sel.sort(function(a,b){ //sort by index
16-
return a.index - b.index;
17-
});
18-
nullLayer.moveBefore(sel[0]); //placing before the 1st
19-
nullLayer.startTime = sel[0].startTime; //trim
20-
nullLayer.inPoint = sel[0].inPoint;
21-
nullLayer.outPoint = sel[0].outPoint;
22-
nullLayer.label = sel[0].label; //inherit color
23-
}
24-
app.endUndoGroup(); //closing undo
25-
}
26-
}
27-
newNull.go()
1+
//Snippet for new trimmed null creation//creates a null trimmed to the highest selected layer//inherits its color//CC-BY-SA Nik Ska, 2013var newNull = {}newNull.go = function(){ var activeComp = app.project.activeItem; //active item if(activeComp && activeComp instanceof CompItem){ //if it's a comp var sel = activeComp.selectedLayers; //selected layers app.beginUndoGroup("Create smart null"); //Undo var nullLayer = activeComp.layers.addNull(); //adding Null if(sel){ //if anything is selected sel.sort(function(a,b){ //sort by index return a.index - b.index; }); nullLayer.moveBefore(sel[0]); //placing before the 1st nullLayer.startTime = sel[0].startTime; //trim nullLayer.inPoint = sel[0].inPoint; nullLayer.outPoint = sel[0].outPoint; nullLayer.label = sel[0].label; //inherit color for(var s = 0; s < sel.length; s++){ sel[s].parent = nullLayer; } } app.endUndoGroup(); //closing undo }}newNull.go()

nullsToOne.jsx

+37
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
//Snippet for converting a pack of nulls into one
2+
//each null represents a frame
3+
4+
//CC-BY Nik Ska, 2014
5+
6+
var activeComp = app.project.activeItem;
7+
if(activeComp && activeComp instanceof CompItem){
8+
var sel = activeComp.selectedLayers;
9+
if(sel.length > 0){
10+
app.beginUndoGroup("Converting nulls to one");
11+
var newTrackNull = activeComp.layers.addNull();
12+
newTrackNull.name = "MasterNull";
13+
newTrackNull.threeDLayer = true;
14+
15+
for(var s = 0; s < sel.length; s++){
16+
t = s*activeComp.frameDuration; //time
17+
var currentNull = sel[s];
18+
//set all properties
19+
newTrackNull.property("ADBE Transform Group").property("ADBE Position").setValueAtTime(t, currentNull.property("ADBE Transform Group").property("ADBE Position").value);
20+
21+
newTrackNull.property("ADBE Transform Group").property("ADBE Anchor Point").setValueAtTime(t, currentNull.property("ADBE Transform Group").property("ADBE Anchor Point").value);
22+
23+
newTrackNull.property("ADBE Transform Group").property("ADBE Rotate Z").setValueAtTime(t, currentNull.property("ADBE Transform Group").property("ADBE Rotate Z").value);
24+
25+
if(sel[s].threeDLayer){
26+
newTrackNull.property("ADBE Transform Group").property("ADBE Rotate X").setValueAtTime(t, currentNull.property("ADBE Transform Group").property("ADBE Rotate X").value);
27+
28+
newTrackNull.property("ADBE Transform Group").property("ADBE Rotate Y").setValueAtTime(t, currentNull.property("ADBE Transform Group").property("ADBE Rotate Y").value);
29+
30+
newTrackNull.property("ADBE Transform Group").property("ADBE Orientation").setValueAtTime(t, currentNull.property("ADBE Transform Group").property("ADBE Orientation").value);
31+
32+
}
33+
}
34+
35+
app.endUndoGroup();
36+
}
37+
}

removeStrokes.jsx

-30
This file was deleted.

0 commit comments

Comments
 (0)