Skip to content

Commit 806710c

Browse files
author
Nik Ska
committed
Prop2Null added
1 parent 7cb1a4f commit 806710c

File tree

1 file changed

+38
-0
lines changed

1 file changed

+38
-0
lines changed

prop2null.jsx

+38
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
//Script for attaching Nulls to selected
2+
//2 and 3-dimension properties
3+
//Useful for Corner Pin, Page Turn and other effects
4+
5+
//USAGE:
6+
//Select properties and launch the script
7+
8+
//CC-BY, Nik Ska, 2016
9+
10+
var prop2null = this;
11+
12+
prop2null.go = function() {
13+
var activeComp = app.project.activeItem;
14+
if(activeComp && activeComp instanceof CompItem){
15+
var sel = activeComp.selectedProperties;
16+
if(sel.length > 0){
17+
for(var s = 0; s < sel.length; s++){
18+
if(sel[s] instanceof Property){
19+
//Choose only selected Properties (not Property Groups)
20+
if((sel[s].value instanceof Array) && (sel[s].canVaryOverTime === true)){
21+
//Choose only 2/3d and those you can apply expression to
22+
var newNull = activeComp.layers.addNull();
23+
newNull.label = 13;
24+
newNull.name = sel[s].name + " control";
25+
newNull.property("ADBE Transform Group").property("ADBE Anchor Point").setValue([50, 50]);
26+
newNull.property("ADBE Transform Group").property("ADBE Scale").expression = "[100, 100]";
27+
newNull.property("ADBE Transform Group").property("ADBE Position").setValue(sel[s].value);
28+
sel[s].expression = "thisComp.layer(" +'"' + newNull.name + '"' + ")('ADBE Transform Group')('ADBE Position')";
29+
}
30+
}
31+
}
32+
}
33+
}
34+
}
35+
36+
app.beginUndoGroup("Properties to Nulls");
37+
prop2null.go();
38+
app.endUndoGroup();

0 commit comments

Comments
 (0)