forked from dokluch/After-Effects-scripting-snippets
-
Notifications
You must be signed in to change notification settings - Fork 3
/
modulo.jsx
40 lines (32 loc) · 1.31 KB
/
modulo.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
//Script for building various modul grids with shapes
var modulo = this;
modulo.buildGUI = function(thisObj){
thisObj.w = (thisObj instanceof Panel) ? thisObj : new Window("palette", thisObj.scriptTitle, undefined, {resizeable:true});
thisObj.w.alignChildren = ['left', 'top']
if (thisObj.w instanceof Window){
thisObj.w.center();
thisObj.w.show();
}
else thisObj.w.layout.layout(true);
}
var activeComp = app.project.activeItem;
var myShape = new Shape();
myShape.vertices = [[0,0], [0,100], [100,100], [100,0]];
myShape.closed = true;
var activeItem = app.project.activeItem;
if (activeItem != null && activeItem instanceof CompItem) {
var shapeLayer = activeItem.layers.addShape();
var contents = shapeLayer.property("ADBE Root Vectors Group");
var g1 = contents.addProperty("ADBE Vector Group").property("ADBE Vectors Group");
g1.addProperty("ADBE Vector Shape - Rect");
g1.addProperty("ADBE Vector Graphic - Stroke");
var repeater = g1.addProperty("ADBE Vector Filter - Repeater");
repeater.property("ADBE Vector Repeater Copies").setValue(4);
repeater.property("ADBE Vector Repeater Transform").property("ADBE Vector Repeater Position").setValue([100,0]);
}
function drawGrid(cols, rows){
var numCols = cols[0];
var colWidth = cols[1];
var numRows = rows[0];
var rowWidth = rows[1];
}