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 ClampNum(num, min, max, inErrReturn) { | |
function SingleChannelClamp(num, min, max) { | |
if ( | |
isNaN(num) || | |
min == undefined || | |
isNaN(min) || | |
isNaN(max) || | |
max == undefined | |
) { | |
return num; |
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 ModNum (n, m) { | |
try { | |
if (n >= m || n <= 0) { | |
return ((n % m) + m) % m; | |
} else { | |
return n; | |
} | |
} catch (e) { | |
// maybe print or alert an error | |
return n; |
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 libForExpressions(){ | |
var theLib = '(function includeJSON(){ if (!this.JSON) { this.JSON = {}; } (function () { function f(n) { return n < 10 ? \'0\' + n : n; } if (typeof Date.prototype.toJSON !== \'function\') { Date.prototype.toJSON = function (key) { return isFinite(this.valueOf()) ? this.getUTCFullYear() + \'-\' + f(this.getUTCMonth() + 1) + \'-\' + f(this.getUTCDate()) + \'T\' + f(this.getUTCHours()) + \':\' + f(this.getUTCMinutes()) + \':\' + f(this.getUTCSeconds()) + \'Z\' : null; }; String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function (key) { return this.valueOf(); }; } var cx = \/[\\u0000\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]\/g, escapable = \/[\\\\\\\"\\x00-\\x1f\\x7f-\\x9f\\u00ad\\u0600-\\u0604\\u070f\\u17b4\\u17b5\\u200c-\\u200f\\u2028-\\u202f\\u2060-\\u206f\\ufeff\\ufff0-\\uffff]\/g, gap, indent, meta = { \'\\b\': \'\\\\b\', \'\\t\': \'\\\\t\', \'\\n\': \'\\\\n |
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 getRenderChimeState () { | |
try { | |
return app.preferences.getPrefAsLong( | |
"Misc Section", | |
"Play sound when render finishes", | |
PREFType.PREF_Type_MACHINE_INDEPENDENT | |
); | |
} catch (e) { | |
// something went wrong, maybe print or alert the error | |
return |
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 RemoveAllChildrenFromPanel (panelObj) { | |
var panelObj = panelObj || undefined; | |
if (!panelObj || !panelObj.children || !panelObj.children.length) { | |
// no panel, or no children found | |
return; | |
} | |
for (var i = panelObj.children.length - 1; i >= 0; i--) { | |
var crntChildren = panelObj.children[i]; |
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 RefreshPanel(panelObj) { | |
try { | |
if (!panelObj) { | |
// no panel or group passed to function | |
return false; | |
} | |
if (!panelObj.size) { | |
// size property of the panelObj wasn't found? | |
return false; | |
} |
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 FillPanel(panelOBJ, color) { | |
if ( | |
panelOBJ && | |
color && | |
(panelOBJ.type == "panel" || | |
panelOBJ.type == "group" || | |
panelOBJ.type == "dialog" || | |
panelOBJ.type == "palette" || | |
panelOBJ.type == "window") && | |
panelOBJ.graphics.BrushType |
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 FillText(textOBJ, color) { | |
if (textOBJ && color) { | |
var g = textOBJ.graphics; | |
g.foregroundColor = g.newPen(g.PenType.SOLID_COLOR, color, 1); | |
} | |
}; |
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 GoodBoyNinjaColorPicker(startValue){ | |
// find the active comp | |
var crntComp = app.project.activeItem; | |
if (!crntComp || !(crntComp instanceof CompItem)) { | |
alert("Please open a comp first"); | |
return []; | |
} | |
// add a temp null; | |
var tempLayer = crntComp.layers.addShape(); |
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 AllEffectsOnLayer(layer) { | |
if (layer !== undefined) { | |
// alert ("shit") | |
var effectsGroup = layer("ADBE Effect Parade"); | |
//var effectsOnLayer = new Array(); |