This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Instead of creating 20 shapes on 2 types, I have created 20 distinctive | |
random dynamic shapes to show the beauty and diversity of randomness | |
Each circle contains a shape with random amount of vertices | |
generated on the circle's edge in random places and moving with | |
random speed in random direction. | |
Click anywhere to get completely different picture | |
Main idea is redrawing all circles on each step | |
through the .update() chain |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//get all first mas vertices info | |
//Nik Ska, 2014 | |
//CC-BY | |
var maskVertex = function(v, inT, outT){ | |
this.vertex = v; | |
this.inTangent = inT; | |
this.outTangent = outT; | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//CC-BY Nik Ska, 2014 | |
var sel = app.project.selection; //selected | |
var used = []; //these were used | |
app.beginUndoGroup("Precomping as hell"); | |
var precompFolder = app.project.items.addFolder("Precomps"); | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function createNull(){ | |
var activeComp = app.project.activeItem; | |
if(!activeComp instanceof CompItem || !activeComp){ | |
alert("No comp selected"); | |
return null; | |
} | |
app.beginUndoGroup("Creatin a null"); | |
if(activeComp.selectedLayers.length != 0){//и если на композиции выделены какие-то слои | |
var sel = activeComp.selectedLayers; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var getTrueValues = function(layer, position, anchor, scale, rotation){ | |
if(layer.parent != null){ | |
var l = layer.parent.property("ADBE Transform Group"); | |
getTrueValues(layer.parent, position+l.property("ADBE Position").value, anchor+l.property("ADBE Anchor Point").value, [scale[0]*l.property("ADBE Scale").value[0], scale[1]*l.property("ADBE Scale").value[1]]/100, rotation+l.property("ADBE Rotate Z").value*Math.PI/180); | |
} | |
else{ | |
var obj = {pos: position, ap: anchor, sc: scale, rot: rotation}; | |
return(obj); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
*Snippet to change target name project-wise. | |
*Comp names and layer names are going to be affected. | |
*I believe there are going to be problems with expressions. | |
*Though I'm not sure | |
* | |
*CC-BY, Nik Ska, 2015 | |
*/ | |
var wrongName = "СС"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var audioSource = thisComp.layer("Audio Amplitude").effect("Both Channels")("Slider"); | |
var step = 1; // step in frames | |
var accum = 0; | |
if(audioSource.numKeys > 0){ | |
var k = 0; | |
if(time >= step*2){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
findCompByName=function(_name){ | |
for(var i=1;i<=app.project.numItems;i++) | |
{ | |
var curItem=app.project.item(i); | |
if (curItem.name==_name && curItem instanceof CompItem) return curItem; | |
} | |
return null; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Скрипт создает шейп, проходящий через position всех выбранных слоев | |
Не будет работать, если: | |
-слои прикреплены к другим слоям | |
-на позиции есть ключевые кадры/выражения | |
-Все в 3д и есть камеры | |
Все эти пункты легко исправляются по необходимости | |
Nik Ska, 2015 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n = 0; | |
t = 0; | |
if (thisProperty.numKeys > 0){ | |
n = thisProperty.nearestKey(time).index; | |
if (thisProperty.key(n).time > time) n--; | |
} | |
if(n < thisProperty.numKeys){ | |
linear(time, thisProperty.key(n).time, thisProperty.key(n+1).time, thisProperty.key(n).value, thisProperty.key(n+1).value) | |
} |
OlderNewer