Skip to content

Commit 78027c8

Browse files
author
Nik Ska
committed
second commit
1 parent 87f7683 commit 78027c8

6 files changed

+518
-0
lines changed

HUD_placer.jsx

+203
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,203 @@
1+
//HUD text placer
2+
//Written by Nik Ska
3+
//Excusively for George Hurdubae
4+
//http://aescripts.com/authors/nik-ska/
5+
//dokluch@gmail.com
6+
7+
var textSetter = this;
8+
9+
if($.os.substr(0,7).toLowerCase() == "windows"){var prefix = "explorer "};
10+
else{var prefix = "open ";}
11+
12+
textSetter.link1 = prefix + "http://videohive.net/item/animated-hud-alphabet/5080801";
13+
textSetter.link2 = prefix + "http://aescripts.com/authors/m-p/nik-ska/";
14+
textSetter.link3 = prefix + "mailto:dokluch@gmail.com";
15+
textSetter.letterMap = ['0','1','2','3','4','5','6','7','8','9',"'",'-','!','"','#','$','%','&','(',')',',','.','/',':',';','?','@','[',"\\",']','€','+','<','=','>','A','a','B','b','C','c','D','d','E','e','F','f','G','g','H','h','I','i','J','j','K','k','L','l','M','m','N','n','O','o','P','p','Q','q','R','r','S','s','space','T','t','U','u','V','v','W','w','X','x','Y','y','Z','z'];
16+
17+
18+
19+
textSetter.setTextLayers = function(thisObj, _text){
20+
var activeComp = app.project.activeItem;
21+
if(activeComp != null && (activeComp instanceof CompItem)) {
22+
if(_text){
23+
var lettersFolder = thisObj.getLettersFolder();
24+
if(lettersFolder){
25+
app.beginUndoGroup("Placing HUD text");
26+
27+
thisObj.posNull = activeComp.layers.addNull();
28+
thisObj.posNull.name = "Text Controller_"+String(thisObj.posNulls);
29+
30+
thisObj.posNull.property("Marker").setValueAtTime(0, new MarkerValue("Adjust " + '"'+ _text +'"' + " size, tracking and position"));
31+
32+
var spacing = thisObj.posNull("Effects").addProperty("ADBE Slider Control");
33+
spacing.name = "Tracking";
34+
spacing.value = 0;
35+
36+
var textSize = thisObj.posNull("Effects").addProperty("ADBE Slider Control");
37+
textSize.name = "Size";
38+
39+
thisObj.posNull.effect(2).slider.setValue(100);
40+
41+
thisObj.posNulls++;
42+
43+
thisObj.posNull.label = (posNulls)%4+11;
44+
thisObj.posNull.transform.position.setValue([-1104,584,0]);
45+
46+
47+
for(var i = 0; i<_text.length; i++){
48+
if(_text[i]!= ' '){
49+
var letterToPlace = thisObj.getLetter(_text[i], lettersFolder, thisObj.letterMap);
50+
if(letterToPlace) var lettr = activeComp.layers.add(letterToPlace);
51+
}
52+
else{
53+
var lettr = activeComp.layers.add(thisObj.getLetter("space", lettersFolder, thisObj.letterMap));
54+
}
55+
if(lettr){
56+
lettr.position.setValue([0,0,0]);
57+
lettr.position.expression = "cntrl = thisComp.layer("+"'"+thisObj.posNull.name+"'"+");\ncntrl.toComp(cntrl.transform.anchorPoint) - (cntrl.index-index)*(7*cntrl.effect(2)(1)+cntrl.effect(1)(1))+value";
58+
lettr.scale.expression = "value*thisComp.layer("+"'"+thisObj.posNull.name+"'"+").effect(2)(1)/100";
59+
lettr.threeDLayer = true;
60+
lettr.collapseTransformation = true;
61+
lettr.label = thisObj.posNull.label;
62+
if(i>0) lettr.moveAfter(activeComp.layers[i+1])
63+
}
64+
}
65+
66+
if(activeComp.layers[1]!=thisObj.posNull){
67+
thisObj.posNull.moveBefore(activeComp.layers[1])
68+
}
69+
70+
for(var k = 1; k<=activeComp.layers.length; k++){
71+
var l = activeComp.layers[k];
72+
if((l.name == "Master Controller") || (l.name == "Camera Controller") || (l.name == "Camera")){
73+
l.moveBefore(activeComp.layers[1]);
74+
}
75+
}
76+
app.endUndoGroup();
77+
}
78+
}
79+
}
80+
}
81+
82+
textSetter.buildGUI = function(thisObj){
83+
thisObj.posNulls = thisObj.findPreviousInstances();
84+
thisObj.w = (thisObj instanceof Panel) ? thisObj : new Window("palette", thisObj.scriptTitle, undefined, {resizeable:false});
85+
thisObj.w.alignChildren = ["left", "top"];
86+
//thisObj.w.setBG([0,.03,.03]);
87+
thisObj.w.minimumSize = "width: 180, height: 110";
88+
thisObj.w.maximumSize = "width:180, height: 110";
89+
90+
thisObj.w.add("staticText", undefined, "HUD text placer");
91+
var textSet = thisObj.w.add("editText", undefined, "Write text and hit Enter");
92+
textSet.size = [150,20];
93+
94+
var lineTwo = thisObj.w.add("group{orientation:'row'}");
95+
lineTwo.size = "width: 155, height: 25"
96+
97+
var aboutBttn = lineTwo.add("button",undefined, "?");//.setFG([1,1,1]);
98+
aboutBttn.alignment = ['right', 'top'];
99+
aboutBttn.size = [20,20];
100+
101+
textSet.onEnterKey = function(){
102+
setTextLayers(thisObj, textSet.text);
103+
}
104+
105+
106+
aboutBttn.onClick = function(){
107+
thisObj.abt = new Window("palette", "About the script",undefined, {resizeable:false});//.setBG([0,.03,.03]);
108+
thisObj.abt.alignChildren = ["left", "top"];
109+
110+
var abtPanel = thisObj.abt.add("panel{text: '', justify: 'center', alignment:['fill','top'], properties:{borderStyle: 'black'}}");
111+
abtPanel.margins = 10;
112+
abtPanel.alignChildren = ['left', 'top'];
113+
114+
abtPanel.add("staticText", undefined, "Script for the HUD Alphabet by IronykDesign");//.setFG([1,1,1]);
115+
abtPanel.add("staticText", undefined, "http://videohive.net/item/animated-hud-alphabet/5080801").setFG([1, 0.58, 0.0]).addEventListener("mouseup", function(k){
116+
if(k.button == 0){
117+
system.callSystem(thisObj.link1)
118+
}
119+
});
120+
121+
abtPanel.add("staticText", undefined, "");
122+
abtPanel.add("staticText", undefined, "Code by Nik Ska");
123+
abtPanel.add("staticText", undefined, "http://aescripts.com/authors/m-p/nik-ska/").setFG([1, 0.58, 0.0]).addEventListener("mouseup", function(k){
124+
if(k.button == 0){
125+
system.callSystem(thisObj.link2);
126+
}
127+
});
128+
abtPanel.add("staticText", undefined, "dokluch@gmail.com").setFG([1, 0.58, 0.0]).addEventListener("mouseup", function(k){
129+
if(k.button == 0){
130+
system.callSystem(thisObj.link3);
131+
}
132+
});
133+
134+
thisObj.abt.center();
135+
thisObj.abt.show();
136+
}
137+
138+
if (thisObj.w instanceof Window){
139+
thisObj.w.center();
140+
thisObj.w.show();
141+
}
142+
else thisObj.w.layout.layout(true);
143+
}
144+
145+
146+
textSetter.getLetter = function(_name, _folder, _map){
147+
function find(n, m){
148+
for(var i = 0; i<m.length; i++){
149+
if(m[i] == n) return i
150+
}
151+
return -1
152+
}
153+
154+
var letterNumber = find(_name, _map);
155+
156+
if(letterNumber>=0){
157+
return _folder.item(letterNumber+1)
158+
}
159+
else return null
160+
}
161+
162+
textSetter.getLettersFolder = function(){
163+
for(var i = 1; i<= app.project.numItems; i++){
164+
if(app.project.item(i).name == "2. Letters"){
165+
return app.project.item(i);
166+
}
167+
}
168+
return null
169+
}
170+
171+
textSetter.findPreviousInstances = function(){
172+
var activeComp = app.project.activeItem;
173+
var rx = /(Text Controller_)(\d)/;
174+
if(activeComp){
175+
var init = 1;
176+
var tmp = 1;
177+
for(var k = 1; k<=activeComp.layers.length; k++){
178+
var match = activeComp.layers[k].name.match(rx);
179+
if(match){
180+
if(Number(match[2])>init) init = Number(match[2]);
181+
}
182+
if(init>tmp) tmp = init;
183+
else if(init == tmp) tmp ++;
184+
}
185+
}
186+
return tmp;
187+
}
188+
189+
Object.prototype.setBG = function (colorArray) {
190+
if (typeof colorArray != 'undefined' && colorArray.length >=3) {
191+
this.graphics.backgroundColor = this.graphics.newBrush(this.graphics.BrushType.SOLID_COLOR, colorArray);
192+
}
193+
return this;
194+
}
195+
196+
Object.prototype.setFG = function(colorArray) {
197+
if (typeof colorArray != 'undefined' && colorArray.length >=3) {
198+
this.graphics.foregroundColor = this.graphics.newPen(this.graphics.PenType.SOLID_COLOR, colorArray, 1);
199+
}
200+
return this;
201+
}
202+
203+
textSetter.buildGUI(textSetter)

applyPseudoEffect.jsx

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
var gridderPseudoEffect = <Effect matchname="GRIDDERControl" name="$$$/AE/Preset/GRIDDERControl=GRIDDERControl">
2+
    <Group name="$$$/AE/Preset/Grid_step=Grid step">
3+
        <Slider name="$$$/AE/Preset/Columns=Columns" default="0" valid_min="-100" valid_max="100" slider_min="0" slider_max="100" precision="1"/>
4+
        <Slider name="$$$/AE/Preset/Rows=Rows" default="0" valid_min="-100" valid_max="100" slider_min="0" slider_max="100" precision="1"/>
5+
    </Group>
6+
    <Group name="$$$/AE/Preset/Grid_Mode=Grid Mode">
7+
        <Checkbox name="$$$/AE/Preset/OnlyColumns=Only Columns" default="true" CANNOT_TIME_VARY="true"/>
8+
        <Checkbox name="$$$/AE/Preset/OnlyRows=Only Rows" default="false" CANNOT_TIME_VARY="true"/>
9+
    </Group>
10+
    <Group name="$$$/AE/Preset/Spacing=Spacing">
11+
        <Slider name="$$$/AE/Preset/X=X" default="0" valid_min="-1000" valid_max="1000" slider_min="0" slider_max="100" precision="1" DISPLAY_PIXEL="true"/>
12+
        <Slider name="$$$/AE/Preset/Y=Y" default="0" valid_min="-1000" valid_max="1000" slider_min="0" slider_max="100" precision="1" DISPLAY_PIXEL="true"/>
13+
        <Checkbox name="$$$/AE/Preset/RectangelGrid=Rectangel Grid" default="true" CANNOT_TIME_VARY="true"/>
14+
    </Group>
15+
    <Group name="$$$/AE/Preset/Grid_Overlay_Controls=Grid Overlay Controls">
16+
        <Color name="$$$/AE/Preset/OverlayColor=Overlay Color" default_red="0" default_green="255" default_blue="255"/>
17+
        <Slider name="$$$/AE/Preset/Thickness=Thickness" default="1" valid_min="0" valid_max="100" slider_min="0" slider_max="20" precision="1"/>
18+
    </Group>
19+
</Effect>;
20+
21+
var activeComp = app.project.activeItem;
22+
23+
24+
try{
25+
activeComp.layer(2).effect.addProperty("Gridder");
26+
}
27+
catch(err){
28+
a= File(Folder.desktop.fullName + "/test.txt");
29+
a.open("w");
30+
a.write(gridderPseudoEffect);
31+
a.close();
32+
}

batchChangeTiming.jsx

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
//script used for batch change timing of selected compositions
2+
//or actve comp with all layers
3+
//useful when working with 3d passes
4+
//Nik Ska, 2013
5+
6+
7+
var chTiming = this;
8+
9+
chTiming.run = function(){
10+
this.buildGUI(this);
11+
}
12+
13+
chTiming.buildGUI = function(thisObj){
14+
thisObj.w = (thisObj instanceof Panel) ? thisObj : new Window("palette", thisObj.scriptTitle, undefined, {resizeable:true});
15+
thisObj.w.alignChildren = ['left', 'top']
16+
thisObj.w.add("staticText", undefined, "Batch Timing Changer 0.1");
17+
var g = thisObj.w.add("group{orientation:'row', alignChildren: ['left', 'top']}");
18+
var timeText = g.add("editText", undefined, "0");
19+
timeText.size = [40, 20];
20+
var modeselect = g.add("dropdownlist", undefined, ["s", "fr"]);
21+
modeselect.selection = 0;
22+
23+
var g2 = thisObj.w.add("group{orientation:'row', alignChildren: ['left', 'top']}");
24+
var recChck = g2.add("checkbox", undefined, "Recursive");
25+
26+
timeText.onEnterKey = function(){
27+
thisObj.changeTiming(Number(timeText.text), modeselect.selection.index, recChck.value);
28+
}
29+
30+
if (thisObj.w instanceof Window){
31+
thisObj.w.center();
32+
thisObj.w.show();
33+
}
34+
else thisObj.w.layout.layout(true);
35+
}
36+
37+
chTiming.changeTiming = function(_time, _sel, recursive){
38+
function loopthrough(){
39+
for(var i = 0; i<vids.length; i++){
40+
if(_sel == 1){_time*=vids[i].frameDuration} //frames
41+
vids[i].duration = _time;
42+
for(var k = 1; k<=vids[i].layers.length; k++){
43+
vids[i].layers[k].outPoint = vids[i].duration;
44+
}
45+
}
46+
}
47+
var sel_vids = app.project.selection;
48+
if(sel_vids.length>0){
49+
var vids = sel_vids;
50+
loopthrough()
51+
}
52+
else if(app.project.activeItem){
53+
var vids = [app.project.activeItem];
54+
loopthrough()
55+
}
56+
57+
58+
}
59+
60+
chTiming.run()

0 commit comments

Comments
 (0)