Compare commits
1
Commits
main
..
e1cf4db294
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e1cf4db294 |
@@ -1,3 +0,0 @@
|
||||
node_modules/
|
||||
docs/
|
||||
.DS_Store
|
||||
Vendored
-21
@@ -1,21 +0,0 @@
|
||||
{
|
||||
// Use IntelliSense to learn about possible attributes.
|
||||
// Hover to view descriptions of existing attributes.
|
||||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
|
||||
"version": "0.2.0",
|
||||
"configurations": [
|
||||
|
||||
{
|
||||
"type": "extendscript-debug",
|
||||
"request": "attach",
|
||||
"name": "Attach to ExtendScript Engine",
|
||||
"hostAppSpecifier": "aftereffects-26.0"
|
||||
},
|
||||
{
|
||||
"type": "extendscript-debug",
|
||||
"request": "launch",
|
||||
"name": "Launch Script in ExtendScript Engine",
|
||||
"hostAppSpecifier": "aftereffects-26.0"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,21 +1,18 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2025 Kyle Harter
|
||||
Copyright (c) 2026 jorge
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
|
||||
associated documentation files (the "Software"), to deal in the Software without restriction, including
|
||||
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
|
||||
following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
The above copyright notice and this permission notice shall be included in all copies or substantial
|
||||
portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
|
||||
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
|
||||
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
||||
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
||||
USE OR OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
@@ -1 +1,3 @@
|
||||
### SPARKS ACCELERATE REPO
|
||||
# sparks-amazon-accelerate-project-tools-Private
|
||||
|
||||
SPARKS ACCELERATE REPO
|
||||
Vendored
BIN
Binary file not shown.
@@ -1,12 +0,0 @@
|
||||
{
|
||||
"labels": [
|
||||
{"label": "HEADING", "prefix": "TEXT-HEADING"},
|
||||
{"label": "SUBHEAD", "prefix": "TEXT-SUBHEAD"},
|
||||
{"label": "EYEBROW", "prefix": "TEXT-EYEBROW"},
|
||||
{"label": "BODY", "prefix": "TEXT-BODY"},
|
||||
{"label": "BODYHEAD", "prefix": "TEXT-BODYHEAD"},
|
||||
{"label": "CHART", "prefix": "TEXT-CHART"},
|
||||
{"label": "DATA", "prefix": "TEXT-DATA"},
|
||||
{"label": "GRAPH", "prefix": "TEXT-GRAPH"}
|
||||
]
|
||||
}
|
||||
@@ -1,13 +0,0 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"module": "none",
|
||||
"target": "ES3",
|
||||
"noLib": true,
|
||||
"checkJs": false,
|
||||
"baseUrl": "./src",
|
||||
"paths": {
|
||||
"*": ["types/*"]
|
||||
}
|
||||
},
|
||||
"include": ["src/**/*"]
|
||||
}
|
||||
-15
@@ -1,15 +0,0 @@
|
||||
{
|
||||
"source": {
|
||||
"include": ["src/library"],
|
||||
"includePattern": ".jsx?$"
|
||||
},
|
||||
"opts": {
|
||||
"destination": "docs",
|
||||
"template": "node_modules/docdash"
|
||||
},
|
||||
"plugins": [],
|
||||
"templates": {
|
||||
"cleverLinks": true,
|
||||
"monospaceLinks": true
|
||||
}
|
||||
}
|
||||
Vendored
BIN
Binary file not shown.
@@ -1,57 +0,0 @@
|
||||
var OS = (function(){
|
||||
function isWindows() {
|
||||
return $.os.indexOf("Windows") != -1;
|
||||
};
|
||||
|
||||
function isMacOS(){
|
||||
return !isWindows();
|
||||
};
|
||||
|
||||
|
||||
function openUrl(url){
|
||||
if(isWindows()){
|
||||
openUrlWin(url);
|
||||
}
|
||||
else {
|
||||
openUrlMac(url);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function openUrlMac(url){
|
||||
var command = 'open "'+url+'"';
|
||||
system.callSystem(command);
|
||||
}
|
||||
|
||||
function openUrlWin(url){
|
||||
var command = 'start ' + url;
|
||||
executeWinCommandlineCommand(command);
|
||||
}
|
||||
|
||||
function executeWinCommandlineCommand(command){
|
||||
var quotedCommand = quoteForWindowsCmd(command);
|
||||
var outerCommand = "cmd /c \""+quotedCommand+"\"";
|
||||
system.callSystem(outerCommand);
|
||||
}
|
||||
|
||||
function quoteForWindowsCmd (string) {
|
||||
// put a ^ before every META character that has a special meaning in CMD
|
||||
var metaChars = ['^','(',')','%','!','"','<','>','&','|','\n'];
|
||||
var prefix ="^"
|
||||
for(var i=0; i< metaChars.length; i++){
|
||||
string = replaceAll(string, metaChars[i],prefix+metaChars[i]);
|
||||
}
|
||||
return string;
|
||||
};
|
||||
|
||||
function replaceAll(string, search, replace){
|
||||
return string.split(search).join(replace);
|
||||
};
|
||||
|
||||
return {
|
||||
isWindows: isWindows,
|
||||
isMacOS: isMacOS,
|
||||
openUrl: openUrl
|
||||
}
|
||||
|
||||
}())
|
||||
File diff suppressed because one or more lines are too long
@@ -1,14 +0,0 @@
|
||||
//@include "OS.jsx"
|
||||
|
||||
function joinPath(components){
|
||||
var pathSeparator = getPathSeparatorSymbol();
|
||||
return components.join(pathSeparator);
|
||||
};
|
||||
|
||||
function getPathSeparatorSymbol(){
|
||||
return (OS.isWindows() ? "\\":"/");
|
||||
};
|
||||
|
||||
function getUserDataFolderPath(){
|
||||
return Folder.userData.fsName;
|
||||
};
|
||||
@@ -1,530 +0,0 @@
|
||||
// json2.js
|
||||
// 2023-05-10
|
||||
// Public Domain.
|
||||
// NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
|
||||
|
||||
// USE YOUR OWN COPY. IT IS EXTREMELY UNWISE TO LOAD CODE FROM SERVERS YOU DO
|
||||
// NOT CONTROL.
|
||||
|
||||
// This file creates a global JSON object containing two methods: stringify
|
||||
// and parse. This file provides the ES5 JSON capability to ES3 systems.
|
||||
// If a project might run on IE8 or earlier, then this file should be included.
|
||||
// This file does nothing on ES5 systems.
|
||||
|
||||
// JSON.stringify(value, replacer, space)
|
||||
// value any JavaScript value, usually an object or array.
|
||||
// replacer an optional parameter that determines how object
|
||||
// values are stringified for objects. It can be a
|
||||
// function or an array of strings.
|
||||
// space an optional parameter that specifies the indentation
|
||||
// of nested structures. If it is omitted, the text will
|
||||
// be packed without extra whitespace. If it is a number,
|
||||
// it will specify the number of spaces to indent at each
|
||||
// level. If it is a string (such as "\t" or " "),
|
||||
// it contains the characters used to indent at each level.
|
||||
// This method produces a JSON text from a JavaScript value.
|
||||
// When an object value is found, if the object contains a toJSON
|
||||
// method, its toJSON method will be called and the result will be
|
||||
// stringified. A toJSON method does not serialize: it returns the
|
||||
// value represented by the name/value pair that should be serialized,
|
||||
// or undefined if nothing should be serialized. The toJSON method
|
||||
// will be passed the key associated with the value, and this will be
|
||||
// bound to the value.
|
||||
|
||||
// For example, this would serialize Dates as ISO strings.
|
||||
|
||||
// Date.prototype.toJSON = function (key) {
|
||||
// function f(n) {
|
||||
// // Format integers to have at least two digits.
|
||||
// return (n < 10)
|
||||
// ? "0" + n
|
||||
// : n;
|
||||
// }
|
||||
// return this.getUTCFullYear() + "-" +
|
||||
// f(this.getUTCMonth() + 1) + "-" +
|
||||
// f(this.getUTCDate()) + "T" +
|
||||
// f(this.getUTCHours()) + ":" +
|
||||
// f(this.getUTCMinutes()) + ":" +
|
||||
// f(this.getUTCSeconds()) + "Z";
|
||||
// };
|
||||
|
||||
// You can provide an optional replacer method. It will be passed the
|
||||
// key and value of each member, with this bound to the containing
|
||||
// object. The value that is returned from your method will be
|
||||
// serialized. If your method returns undefined, then the member will
|
||||
// be excluded from the serialization.
|
||||
|
||||
// If the replacer parameter is an array of strings, then it will be
|
||||
// used to select the members to be serialized. It filters the results
|
||||
// such that only members with keys listed in the replacer array are
|
||||
// stringified.
|
||||
|
||||
// Values that do not have JSON representations, such as undefined or
|
||||
// functions, will not be serialized. Such values in objects will be
|
||||
// dropped; in arrays they will be replaced with null. You can use
|
||||
// a replacer function to replace those with JSON values.
|
||||
|
||||
// JSON.stringify(undefined) returns undefined.
|
||||
|
||||
// The optional space parameter produces a stringification of the
|
||||
// value that is filled with line breaks and indentation to make it
|
||||
// easier to read.
|
||||
|
||||
// If the space parameter is a non-empty string, then that string will
|
||||
// be used for indentation. If the space parameter is a number, then
|
||||
// the indentation will be that many spaces.
|
||||
|
||||
// Example:
|
||||
|
||||
// text = JSON.stringify(["e", {pluribus: "unum"}]);
|
||||
// // text is '["e",{"pluribus":"unum"}]'
|
||||
|
||||
// text = JSON.stringify(["e", {pluribus: "unum"}], null, "\t");
|
||||
// // text is '[\n\t"e",\n\t{\n\t\t"pluribus": "unum"\n\t}\n]'
|
||||
|
||||
// text = JSON.stringify([new Date()], function (key, value) {
|
||||
// return this[key] instanceof Date
|
||||
// ? "Date(" + this[key] + ")"
|
||||
// : value;
|
||||
// });
|
||||
// // text is '["Date(---current time---)"]'
|
||||
|
||||
// JSON.parse(text, reviver)
|
||||
// This method parses a JSON text to produce an object or array.
|
||||
// It can throw a SyntaxError exception.
|
||||
|
||||
// The optional reviver parameter is a function that can filter and
|
||||
// transform the results. It receives each of the keys and values,
|
||||
// and its return value is used instead of the original value.
|
||||
// If it returns what it received, then the structure is not modified.
|
||||
// If it returns undefined then the member is deleted.
|
||||
|
||||
// Example:
|
||||
|
||||
// // Parse the text. Values that look like ISO date strings will
|
||||
// // be converted to Date objects.
|
||||
|
||||
// myData = JSON.parse(text, function (key, value) {
|
||||
// var a;
|
||||
// if (typeof value === "string") {
|
||||
// a =
|
||||
// /^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2}(?:\.\d*)?)Z$/.exec(value);
|
||||
// if (a) {
|
||||
// return new Date(Date.UTC(
|
||||
// +a[1], +a[2] - 1, +a[3], +a[4], +a[5], +a[6]
|
||||
// ));
|
||||
// }
|
||||
// return value;
|
||||
// }
|
||||
// });
|
||||
|
||||
// myData = JSON.parse(
|
||||
// "[\"Date(09/09/2001)\"]",
|
||||
// function (key, value) {
|
||||
// var d;
|
||||
// if (
|
||||
// typeof value === "string"
|
||||
// && value.slice(0, 5) === "Date("
|
||||
// && value.slice(-1) === ")"
|
||||
// ) {
|
||||
// d = new Date(value.slice(5, -1));
|
||||
// if (d) {
|
||||
// return d;
|
||||
// }
|
||||
// }
|
||||
// return value;
|
||||
// }
|
||||
// );
|
||||
|
||||
// This is a reference implementation. You are free to copy, modify, or
|
||||
// redistribute.
|
||||
|
||||
/*jslint
|
||||
eval, for, this
|
||||
*/
|
||||
|
||||
/*property
|
||||
JSON, apply, call, charCodeAt, getUTCDate, getUTCFullYear, getUTCHours,
|
||||
getUTCMinutes, getUTCMonth, getUTCSeconds, hasOwnProperty, join,
|
||||
lastIndex, length, parse, prototype, push, replace, slice, stringify,
|
||||
test, toJSON, toString, valueOf
|
||||
*/
|
||||
|
||||
|
||||
// Create a JSON object only if one does not already exist. We create the
|
||||
// methods in a closure to avoid creating global variables.
|
||||
|
||||
if (typeof JSON !== "object") {
|
||||
JSON = {};
|
||||
}
|
||||
|
||||
(function () {
|
||||
"use strict";
|
||||
|
||||
var rx_one = /^[\],:{}\s]*$/;
|
||||
var rx_two = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g;
|
||||
var rx_three = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g;
|
||||
var rx_four = /(?:^|:|,)(?:\s*\[)+/g;
|
||||
var rx_escapable = /[\\"\u0000-\u001f\u007f-\u009f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
|
||||
var rx_dangerous = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g;
|
||||
|
||||
function f(n) {
|
||||
// Format integers to have at least two digits.
|
||||
return (n < 10)
|
||||
? "0" + n
|
||||
: n;
|
||||
}
|
||||
|
||||
function this_value() {
|
||||
return this.valueOf();
|
||||
}
|
||||
|
||||
if (typeof Date.prototype.toJSON !== "function") {
|
||||
|
||||
Date.prototype.toJSON = function () {
|
||||
|
||||
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;
|
||||
};
|
||||
|
||||
Boolean.prototype.toJSON = this_value;
|
||||
Number.prototype.toJSON = this_value;
|
||||
String.prototype.toJSON = this_value;
|
||||
}
|
||||
|
||||
var gap;
|
||||
var indent;
|
||||
var meta;
|
||||
var rep;
|
||||
|
||||
|
||||
function quote(string) {
|
||||
|
||||
// If the string contains no control characters, no quote characters, and no
|
||||
// backslash characters, then we can safely slap some quotes around it.
|
||||
// Otherwise we must also replace the offending characters with safe escape
|
||||
// sequences.
|
||||
|
||||
rx_escapable.lastIndex = 0;
|
||||
return rx_escapable.test(string)
|
||||
? "\"" + string.replace(rx_escapable, function (a) {
|
||||
var c = meta[a];
|
||||
return typeof c === "string"
|
||||
? c
|
||||
: "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4);
|
||||
}) + "\""
|
||||
: "\"" + string + "\"";
|
||||
}
|
||||
|
||||
|
||||
function str(key, holder) {
|
||||
|
||||
// Produce a string from holder[key].
|
||||
|
||||
var i; // The loop counter.
|
||||
var k; // The member key.
|
||||
var v; // The member value.
|
||||
var length;
|
||||
var mind = gap;
|
||||
var partial;
|
||||
var value = holder[key];
|
||||
|
||||
// If the value has a toJSON method, call it to obtain a replacement value.
|
||||
|
||||
if (
|
||||
value
|
||||
&& typeof value === "object"
|
||||
&& typeof value.toJSON === "function"
|
||||
) {
|
||||
value = value.toJSON(key);
|
||||
}
|
||||
|
||||
// If we were called with a replacer function, then call the replacer to
|
||||
// obtain a replacement value.
|
||||
|
||||
if (typeof rep === "function") {
|
||||
value = rep.call(holder, key, value);
|
||||
}
|
||||
|
||||
// What happens next depends on the value's type.
|
||||
|
||||
switch (typeof value) {
|
||||
case "string":
|
||||
return quote(value);
|
||||
|
||||
case "number":
|
||||
|
||||
// JSON numbers must be finite. Encode non-finite numbers as null.
|
||||
|
||||
return (isFinite(value))
|
||||
? String(value)
|
||||
: "null";
|
||||
|
||||
case "boolean":
|
||||
case "null":
|
||||
|
||||
// If the value is a boolean or null, convert it to a string. Note:
|
||||
// typeof null does not produce "null". The case is included here in
|
||||
// the remote chance that this gets fixed someday.
|
||||
|
||||
return String(value);
|
||||
|
||||
// If the type is "object", we might be dealing with an object or an array or
|
||||
// null.
|
||||
|
||||
case "object":
|
||||
|
||||
// Due to a specification blunder in ECMAScript, typeof null is "object",
|
||||
// so watch out for that case.
|
||||
|
||||
if (!value) {
|
||||
return "null";
|
||||
}
|
||||
|
||||
// Make an array to hold the partial results of stringifying this object value.
|
||||
|
||||
gap += indent;
|
||||
partial = [];
|
||||
|
||||
// Is the value an array?
|
||||
|
||||
if (Object.prototype.toString.apply(value) === "[object Array]") {
|
||||
|
||||
// The value is an array. Stringify every element. Use null as a placeholder
|
||||
// for non-JSON values.
|
||||
|
||||
length = value.length;
|
||||
for (i = 0; i < length; i += 1) {
|
||||
partial[i] = str(i, value) || "null";
|
||||
}
|
||||
|
||||
// Join all of the elements together, separated with commas, and wrap them in
|
||||
// brackets.
|
||||
|
||||
v = partial.length === 0
|
||||
? "[]"
|
||||
: gap
|
||||
? (
|
||||
"[\n"
|
||||
+ gap
|
||||
+ partial.join(",\n" + gap)
|
||||
+ "\n"
|
||||
+ mind
|
||||
+ "]"
|
||||
)
|
||||
: "[" + partial.join(",") + "]";
|
||||
gap = mind;
|
||||
return v;
|
||||
}
|
||||
|
||||
// If the replacer is an array, use it to select the members to be stringified.
|
||||
|
||||
if (rep && typeof rep === "object") {
|
||||
length = rep.length;
|
||||
for (i = 0; i < length; i += 1) {
|
||||
if (typeof rep[i] === "string") {
|
||||
k = rep[i];
|
||||
v = str(k, value);
|
||||
if (v) {
|
||||
partial.push(quote(k) + (
|
||||
(gap)
|
||||
? ": "
|
||||
: ":"
|
||||
) + v);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
// Otherwise, iterate through all of the keys in the object.
|
||||
|
||||
for (k in value) {
|
||||
if (Object.prototype.hasOwnProperty.call(value, k)) {
|
||||
v = str(k, value);
|
||||
if (v) {
|
||||
partial.push(quote(k) + (
|
||||
(gap)
|
||||
? ": "
|
||||
: ":"
|
||||
) + v);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Join all of the member texts together, separated with commas,
|
||||
// and wrap them in braces.
|
||||
|
||||
v = partial.length === 0
|
||||
? "{}"
|
||||
: gap
|
||||
? "{\n" + gap + partial.join(",\n" + gap) + "\n" + mind + "}"
|
||||
: "{" + partial.join(",") + "}";
|
||||
gap = mind;
|
||||
return v;
|
||||
}
|
||||
}
|
||||
|
||||
// If the JSON object does not yet have a stringify method, give it one.
|
||||
|
||||
if (typeof JSON.stringify !== "function") {
|
||||
meta = { // table of character substitutions
|
||||
"\b": "\\b",
|
||||
"\t": "\\t",
|
||||
"\n": "\\n",
|
||||
"\f": "\\f",
|
||||
"\r": "\\r",
|
||||
"\"": "\\\"",
|
||||
"\\": "\\\\"
|
||||
};
|
||||
JSON.stringify = function (value, replacer, space) {
|
||||
|
||||
// The stringify method takes a value and an optional replacer, and an optional
|
||||
// space parameter, and returns a JSON text. The replacer can be a function
|
||||
// that can replace values, or an array of strings that will select the keys.
|
||||
// A default replacer method can be provided. Use of the space parameter can
|
||||
// produce text that is more easily readable.
|
||||
|
||||
var i;
|
||||
gap = "";
|
||||
indent = "";
|
||||
|
||||
// If the space parameter is a number, make an indent string containing that
|
||||
// many spaces.
|
||||
|
||||
if (typeof space === "number") {
|
||||
for (i = 0; i < space; i += 1) {
|
||||
indent += " ";
|
||||
}
|
||||
|
||||
// If the space parameter is a string, it will be used as the indent string.
|
||||
|
||||
} else if (typeof space === "string") {
|
||||
indent = space;
|
||||
}
|
||||
|
||||
// If there is a replacer, it must be a function or an array.
|
||||
// Otherwise, throw an error.
|
||||
|
||||
rep = replacer;
|
||||
if (replacer && typeof replacer !== "function" && (
|
||||
typeof replacer !== "object"
|
||||
|| typeof replacer.length !== "number"
|
||||
)) {
|
||||
throw new Error("JSON.stringify");
|
||||
}
|
||||
|
||||
// Make a fake root object containing our value under the key of "".
|
||||
// Return the result of stringifying the value.
|
||||
|
||||
return str("", {"": value});
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
// If the JSON object does not yet have a parse method, give it one.
|
||||
|
||||
if (typeof JSON.parse !== "function") {
|
||||
JSON.parse = function (text, reviver) {
|
||||
|
||||
// The parse method takes a text and an optional reviver function, and returns
|
||||
// a JavaScript value if the text is a valid JSON text.
|
||||
|
||||
var j;
|
||||
|
||||
function walk(holder, key) {
|
||||
|
||||
// The walk method is used to recursively walk the resulting structure so
|
||||
// that modifications can be made.
|
||||
|
||||
var k;
|
||||
var v;
|
||||
var value = holder[key];
|
||||
if (value && typeof value === "object") {
|
||||
for (k in value) {
|
||||
if (Object.prototype.hasOwnProperty.call(value, k)) {
|
||||
v = walk(value, k);
|
||||
if (v !== undefined) {
|
||||
value[k] = v;
|
||||
} else {
|
||||
delete value[k];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return reviver.call(holder, key, value);
|
||||
}
|
||||
|
||||
|
||||
// Parsing happens in four stages. In the first stage, we replace certain
|
||||
// Unicode characters with escape sequences. JavaScript handles many characters
|
||||
// incorrectly, either silently deleting them, or treating them as line endings.
|
||||
|
||||
text = String(text);
|
||||
rx_dangerous.lastIndex = 0;
|
||||
if (rx_dangerous.test(text)) {
|
||||
text = text.replace(rx_dangerous, function (a) {
|
||||
return (
|
||||
"\\u"
|
||||
+ ("0000" + a.charCodeAt(0).toString(16)).slice(-4)
|
||||
);
|
||||
});
|
||||
}
|
||||
|
||||
// In the second stage, we run the text against regular expressions that look
|
||||
// for non-JSON patterns. We are especially concerned with "()" and "new"
|
||||
// because they can cause invocation, and "=" because it can cause mutation.
|
||||
// But just to be safe, we want to reject all unexpected forms.
|
||||
|
||||
// We split the second stage into 4 regexp operations in order to work around
|
||||
// crippling inefficiencies in IE's and Safari's regexp engines. First we
|
||||
// replace the JSON backslash pairs with "@" (a non-JSON character). Second, we
|
||||
// replace all simple value tokens with "]" characters. Third, we delete all
|
||||
// open brackets that follow a colon or comma or that begin the text. Finally,
|
||||
// we look to see that the remaining characters are only whitespace or "]" or
|
||||
// "," or ":" or "{" or "}". If that is so, then the text is safe for eval.
|
||||
|
||||
if (
|
||||
rx_one.test(
|
||||
text
|
||||
.replace(rx_two, "@")
|
||||
.replace(rx_three, "]")
|
||||
.replace(rx_four, "")
|
||||
)
|
||||
) {
|
||||
|
||||
// In the third stage we use the eval function to compile the text into a
|
||||
// JavaScript structure. The "{" operator is subject to a syntactic ambiguity
|
||||
// in JavaScript: it can begin a block or an object literal. We wrap the text
|
||||
// in parens to eliminate the ambiguity.
|
||||
|
||||
j = eval("(" + text + ")");
|
||||
|
||||
// In the optional fourth stage, we recursively walk the new structure, passing
|
||||
// each name/value pair to a reviver function for possible transformation.
|
||||
|
||||
return (typeof reviver === "function")
|
||||
? walk({"": j}, "")
|
||||
: j;
|
||||
}
|
||||
|
||||
// If the text is not JSON parseable, then a SyntaxError is thrown.
|
||||
|
||||
throw new SyntaxError("JSON.parse");
|
||||
};
|
||||
}
|
||||
}());
|
||||
@@ -1,383 +0,0 @@
|
||||
/**
|
||||
* Kyle Harter function library
|
||||
* @module km-helper-functions
|
||||
* @author kylenmotion@gmail.com
|
||||
* @returns {object} returns exported modules to be used in other jsx files
|
||||
*/
|
||||
|
||||
var kmFunction = (function () {
|
||||
/**
|
||||
* gets current project
|
||||
* @function getProj
|
||||
* @returns {object} current project
|
||||
*/
|
||||
function getProj() {
|
||||
var proj = app.project;
|
||||
if (!proj) {
|
||||
alert(
|
||||
"Whoops!\rYou don't have any projects open. Open a current project or create a new project and try again.",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
return proj;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the active comp
|
||||
* @function getActiveComp
|
||||
* @param {Project} proj - the current AE project
|
||||
* @returns {CompItem} active composition object in ae project
|
||||
*/
|
||||
|
||||
function getActiveComp(proj) {
|
||||
var activeComp = proj.activeItem;
|
||||
|
||||
if (!(activeComp && activeComp instanceof CompItem)) {
|
||||
alert(
|
||||
"Whoops!\rYou don't have an comp item active. Open a comp item or select a comp item from the project panel and try again.",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
return activeComp;
|
||||
}
|
||||
|
||||
/** gets selected comps as well as their names and unique ids in the project panel
|
||||
* @function getSelectedComps
|
||||
* @param {Project} proj - the current AE project
|
||||
* @returns {object} an object that stores arrays of selected comp objects, names, and ids
|
||||
*/
|
||||
|
||||
function getSelectedComps(proj) {
|
||||
var comps = [];
|
||||
var compNames = [];
|
||||
var compIds = [];
|
||||
|
||||
var selectedItems = proj.selection;
|
||||
|
||||
if (selectedItems.length < 1) {
|
||||
alert(
|
||||
"Whoops!\rYou don't have any project items selected. Select at least 1 project item and try again.",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
var found = false;
|
||||
|
||||
for (var i = 0; i < selectedItems.length; i++) {
|
||||
var item = selectedItems[i];
|
||||
if (item instanceof CompItem) {
|
||||
found = true;
|
||||
comps.push(item);
|
||||
compNames.push(item.name);
|
||||
compIds.push(item.id);
|
||||
}
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
alert(
|
||||
"Whoops!\rYou don't have any comp items selected. Select atleast 1 comp item and try again.",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
return {
|
||||
comps: comps,
|
||||
compNames: compNames,
|
||||
compIds: compIds,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* converts a hex code into a usable RGB array
|
||||
* @function hexToRGB
|
||||
* @param {string} hexValue - a 6-character string that makes up a hex code. Can be used with or without a '#'.
|
||||
* @returns {Array} a 3 element array that makes up a full RGB value
|
||||
*/
|
||||
function hexToRGB(hexValue) {
|
||||
var hexTrim = hexValue.trim();
|
||||
var hexString = hexTrim;
|
||||
var finalHex = hexString.replace(/[#]/g, "");
|
||||
var hexColor = "0x" + finalHex;
|
||||
var r = hexColor >> 16;
|
||||
var g = (hexColor & 0x00ff00) >> 8;
|
||||
var b = hexColor & 0xff;
|
||||
|
||||
return [r / 255, g / 255, b / 255];
|
||||
}
|
||||
|
||||
/**
|
||||
* gets selected layers in comp
|
||||
* @function getSelectedLayers
|
||||
* @param {CompItem} comp - current active or selected comp
|
||||
* @return {Array} returns an array of selected layers in comp
|
||||
*/
|
||||
function getSelectedLayers(comp) {
|
||||
if (!comp) return;
|
||||
var selLayers = comp.selectedLayers;
|
||||
if (selLayers.length < 1) {
|
||||
alert(
|
||||
"Whoops!\rYou don't have any layers selected in your comp. Select atleast 1 layer and try again.",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
return selLayers;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets selected properties on a layer
|
||||
* @function getSelectedProperties
|
||||
* @param {LayerCollection} layers - current selected layers in active comp
|
||||
* @return {array} selected keyframeable properties on a layer
|
||||
*/
|
||||
|
||||
function getSelectedProperties(layers) {
|
||||
if (!layers) return;
|
||||
|
||||
var selLayerProps = [];
|
||||
var found = false;
|
||||
for (var b = 0; b < layers.length; b++) {
|
||||
var layer = layers[b];
|
||||
var selProps = layer.selectedProperties;
|
||||
for (var i = 0; i < selProps.length; i++) {
|
||||
var prop = selProps[i];
|
||||
if (prop.propertyType === PropertyType.PROPERTY && prop.canVaryOverTime) {
|
||||
found = true;
|
||||
selLayerProps.push(prop);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
alert(
|
||||
"Whoops!\rYou don't have any keyframeable layer properties selected. Select atleast 1 keyframeable layer property and try again",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
return selLayerProps;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets selected keyframes on layers in the comp
|
||||
*
|
||||
* @param {Object} props - selected properties on selected layers
|
||||
* @return {Object} an object that stores arrays of selected keyframe objects, times, and values
|
||||
*/
|
||||
function getSelectedKeyframes(props) {
|
||||
if (!props) return;
|
||||
var selKeys = [];
|
||||
var keyInSpatialTan = [];
|
||||
var keyInTemporalEase = [];
|
||||
var keyOutSpatialTan = [];
|
||||
var keyOutTemporalEase = [];
|
||||
var keyLabel = [];
|
||||
var selKeyVal = [];
|
||||
var found = false;
|
||||
for (var i = 0; i < props.length; i++) {
|
||||
var prop = props[i];
|
||||
if (prop.selectedKeys.length > 0) {
|
||||
found = true;
|
||||
for (var k = 0; k < prop.selectedKeys.length; k++) {
|
||||
var keyIndex = prop.selectedKeys[k];
|
||||
selKeys.push(keyIndex);
|
||||
selKeyVal.push(prop.keyValue(keyIndex));
|
||||
keyInSpatialTan.push(prop.keyInSpatialTangent(keyIndex));
|
||||
keyInTemporalEase.push(prop.keyInTemporalEase(keyIndex));
|
||||
keyOutSpatialTan.push(prop.keyOutSpatialTangent(keyIndex));
|
||||
keyOutTemporalEase.push(prop.keyOutTemporalEase(keyIndex));
|
||||
keyLabel.push(prop.keyLabel(keyIndex));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!found) {
|
||||
alert(
|
||||
"Whoops!\rYou don't have any keyframes selected. Select atleast 1 keyframe and try again.",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
return {
|
||||
selKeys: selKeys,
|
||||
selKeyVal: selKeyVal,
|
||||
keyInSpatialTan: keyInSpatialTan,
|
||||
keyInTemporalEase: keyInTemporalEase,
|
||||
keyOutSpatialTan: keyOutSpatialTan,
|
||||
keyOutTemporalEase: keyOutTemporalEase,
|
||||
keyLabel: keyLabel,
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* gets or creates a folder object based on the search term of the match string paramater
|
||||
* @function getOrCreateFolder
|
||||
* @param {object} proj - current AE project object
|
||||
* @param {string} folderName - a valid string used to search for a folder name
|
||||
* @return {object} - the folder object that was either created or found using the search parameter
|
||||
*/
|
||||
|
||||
function getOrCreateFolder(proj, folderName) {
|
||||
if (!proj) return;
|
||||
if (typeof folderName !== "string") {
|
||||
folderName = folderName.toString();
|
||||
}
|
||||
|
||||
var folder = null;
|
||||
for (var i = 1; i <= proj.numItems; i++) {
|
||||
var item = proj.item(i);
|
||||
if (item instanceof FolderItem && item.name === folderName) {
|
||||
folder = item;
|
||||
return folder;
|
||||
}
|
||||
}
|
||||
|
||||
if (folder === null) {
|
||||
folder = proj.items.addFolder(folderName);
|
||||
}
|
||||
return folder;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @function traverseFolder
|
||||
* @param {object} container - object with a number of items greater than 0
|
||||
* @param {Function} callback
|
||||
* @return {null}
|
||||
*/
|
||||
function traverseFolder(container, callback) {
|
||||
for (var i = 1; i <= container.numItems; i++) {
|
||||
var item = container.item(i);
|
||||
|
||||
var result = callback(item);
|
||||
if (result) return result;
|
||||
|
||||
if (item instanceof FolderItem) {
|
||||
var nested = traverseFolder(item, callback);
|
||||
if (nested) return nested;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @function traverseProperties
|
||||
* @param {CompItem} comp - object with a number of items greater than 0
|
||||
* @param {Function} callback -
|
||||
* @return {null}
|
||||
*/
|
||||
function traverseProperties(layer, callback) {
|
||||
for (var b = 1; b <= layer.numProperties; b++) {
|
||||
var prop = layer.property(b);
|
||||
callback(prop);
|
||||
if (prop.numProperties > 0) {
|
||||
traverseProperties(prop, callback);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @function traverseComps
|
||||
* @param {CompItem} comp - object with a number of items greater than 0
|
||||
* @param {Function} callback
|
||||
* @return {null}
|
||||
*/
|
||||
function traverseComps(comp, callback, visited) {
|
||||
if (!visited) visited = {};
|
||||
|
||||
if (visited[comp.id]) return;
|
||||
|
||||
visited[comp.id] = true;
|
||||
|
||||
for (var i = 1; i <= comp.numLayers; i++) {
|
||||
var layer = comp.layer(i);
|
||||
callback(layer);
|
||||
if (layer.source instanceof CompItem) {
|
||||
traverseComps(layer.source, callback, visited);
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* finds comp by name via recursion
|
||||
* @function findCompByName
|
||||
* @param {string} name - a valid string used to search for a comp name
|
||||
* @return {CompItem}
|
||||
*/
|
||||
|
||||
function findCompByName(name) {
|
||||
return traverseFolder(app.project, function (item) {
|
||||
if (item instanceof CompItem && item.name === name) {
|
||||
return item;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* adds selected comps to the render queue and applies output module and token templates
|
||||
* @function addCompsToRQ
|
||||
* @param {CompItem} comps - an array of selected compositions in the project panel or the current active comp
|
||||
* @param {String} module - a string representing the Output Module Template
|
||||
* @param {String} tokenPath - a string representing the Output Destination Render Token
|
||||
* @param {Boolean} imageFlag - a boolean that determines if the output is a still frame output or full sequence
|
||||
* @returns nothing
|
||||
*
|
||||
*/
|
||||
function addCompsToRQ(comps, module, tokenPath, imageFlag) {
|
||||
var proj = app.project;
|
||||
var renderQueue = proj.renderQueue;
|
||||
|
||||
while (renderQueue.numItems > 0) {
|
||||
renderQueue.item(1).remove();
|
||||
}
|
||||
|
||||
for (var i = 0; i < comps.length; i++) {
|
||||
var comp = comps[i];
|
||||
if (imageFlag) {
|
||||
comp.workAreaStart = 0;
|
||||
comp.workAreaDuration = comp.frameDuration * 1;
|
||||
} else {
|
||||
comp.workAreaStart = 0;
|
||||
comp.workAreaDuration = comp.duration;
|
||||
}
|
||||
for (var b = 1; b <= proj.numItems; b++) {
|
||||
var item = proj.item(b);
|
||||
if (item.id === comp.id) {
|
||||
var rqItem = renderQueue.items.add(comp);
|
||||
var rqOM = rqItem.outputModule(1);
|
||||
rqOM.applyTemplate(module);
|
||||
var fileInfo = {
|
||||
"Output File Info": {
|
||||
"Full Flat Path": tokenPath,
|
||||
},
|
||||
};
|
||||
rqOM.setSettings(fileInfo);
|
||||
// rqOM.file = new File(tokenPath);
|
||||
}
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
return {
|
||||
getProj: getProj,
|
||||
getActiveComp: getActiveComp,
|
||||
getSelectedComps: getSelectedComps,
|
||||
hexToRGB: hexToRGB,
|
||||
getSelectedLayers: getSelectedLayers,
|
||||
getSelectedProperties: getSelectedProperties,
|
||||
getOrCreateFolder: getOrCreateFolder,
|
||||
addCompsToRQ: addCompsToRQ,
|
||||
getSelectedKeyframes: getSelectedKeyframes,
|
||||
traverseFolder: traverseFolder,
|
||||
traverseProperties: traverseProperties,
|
||||
traverseComps: traverseComps,
|
||||
findCompByName: findCompByName,
|
||||
};
|
||||
})();
|
||||
@@ -1,75 +0,0 @@
|
||||
/**
|
||||
* Kyle Harter's Script UI library
|
||||
* @module km-scriptUI-functions
|
||||
* @author Kyle Harter
|
||||
* @returns {object} returns exported modules to be used in other jsx files
|
||||
*/
|
||||
|
||||
var kmScriptUI = (function(){
|
||||
|
||||
var scriptName = "insert-script name";
|
||||
|
||||
/**
|
||||
* shows help window for script
|
||||
* @function showHelp
|
||||
* @return {Object} a script UI window
|
||||
*/
|
||||
|
||||
function showHelp(){
|
||||
|
||||
var settingsWindow = new Window("palette", "About " + scriptName, undefined, {closeButton: true, resizeable: true});
|
||||
settingsWindow.orientation = 'column';
|
||||
settingsWindow.alignChildren = ["fill", "fill"];
|
||||
|
||||
var editTextGroup = settingsWindow.add("group", undefined, "Middle Info Group");
|
||||
editTextGroup.orientation = 'column';
|
||||
editTextGroup.alignChildren = ["left", "top"];
|
||||
var helpMessage =
|
||||
'ABOUT '+scriptName.toUpperCase()+'\r\r\
|
||||
INSERT INFO ABOUT SCRIPT HERE\r\r\
|
||||
------------------------\
|
||||
HOW TO USE '+scriptName.toUpperCase()+':\r\r\
|
||||
STEP ##: STEP DETAIL\r\
|
||||
INSERT STEP DETAIL HERE\r\r\
|
||||
-----------\r\
|
||||
'
|
||||
var textBox = editTextGroup.add("edittext", undefined, helpMessage, {multiline: true, readonly: true ,scrollable: true});
|
||||
textBox.justify = "left";
|
||||
textBox.alignment = ["fill","fill"];
|
||||
textBox.preferredSize = [600,200];
|
||||
|
||||
var creatorInfo =
|
||||
''+scriptName+' v1.0\r\
|
||||
Script created by Kyle Harter\r\
|
||||
www.kylemotion.com'
|
||||
|
||||
|
||||
var bottomGroup = settingsWindow.add("group", undefined, "bottomGroup");
|
||||
bottomGroup.orientation = "row";
|
||||
bottomGroup.alignChildren = ["fill", "center"];
|
||||
var creatorGroup = bottomGroup.add("group", undefined, "Creator Info Group")
|
||||
var creatorStatic = creatorGroup.add("statictext", undefined, creatorInfo, {multiline: true});
|
||||
var closeGroup = bottomGroup.add("group", undefined, "Close Group");
|
||||
closeGroup.alignChildren = ["right", "center"];
|
||||
var closeButton = closeGroup.add("button", undefined, "Close");
|
||||
closeButton.preferredSize = [-1, 30];
|
||||
|
||||
|
||||
creatorStatic.addEventListener("mousedown", function () {
|
||||
var userOS = OS
|
||||
var launchCode = userOS.openUrl("https://www.kylemotion.com/")
|
||||
});
|
||||
|
||||
closeButton.addEventListener("mousedown", function(){settingsWindow.close()})
|
||||
|
||||
|
||||
settingsWindow.hide();
|
||||
settingsWindow.show();
|
||||
|
||||
|
||||
}
|
||||
|
||||
return {
|
||||
showHelp: showHelp
|
||||
}
|
||||
})()
|
||||
@@ -1,70 +0,0 @@
|
||||
/**
|
||||
* Kyle Harter systems function library
|
||||
* @module km-system-functions
|
||||
* @author kylenmotion@gmail.com
|
||||
* @returns {object} returns exported modules to be used in other jsx files
|
||||
*/
|
||||
|
||||
var kmSystemsLib = (function () {
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param {String} folderPath - valid file system string
|
||||
* @return {Folder} returns folder object
|
||||
*/
|
||||
function getSystemFolder(folderPath) {
|
||||
if (!folderPath) {
|
||||
alert(
|
||||
"Whoops!\rYou didn't enter a valid folder path string. Enter a valid folder path string and try again.",
|
||||
);
|
||||
return;
|
||||
}
|
||||
|
||||
var folder = new Folder(folderPath);
|
||||
|
||||
if (!folder.exists) {
|
||||
folder.create();
|
||||
}
|
||||
|
||||
return folder;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param {File} file - file system object
|
||||
* @param {Array} contents - an array that holds an object of data to be logged
|
||||
* @param {String} logTitle - valid string to be placed in the title of the log file
|
||||
* @return {String} Contents of the log file
|
||||
*/
|
||||
function writeLogFile(file, contents, logTitle) {
|
||||
var logTitle = "<----- " + logTitle + "----->";
|
||||
var newDate = new Date();
|
||||
var systemLogTime = newDate.toString();
|
||||
var logFile = logTitle + "\r" + "Logged At: " + systemLogTime + "\r\r";
|
||||
|
||||
for (var i = 0; i < contents.length; i++) {
|
||||
var currentObj = contents[i];
|
||||
for (var key in currentObj) {
|
||||
if (currentObj.hasOwnProperty(key)) {
|
||||
logFile += key + ": " + currentObj[key] + "\r";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!file) {
|
||||
file.open("w");
|
||||
} else {
|
||||
file.open("a");
|
||||
}
|
||||
file.write(logFile);
|
||||
file.close();
|
||||
|
||||
return logFile;
|
||||
}
|
||||
|
||||
return {
|
||||
getSystemFolder: getSystemFolder,
|
||||
writeLogFile: writeLogFile,
|
||||
};
|
||||
})();
|
||||
@@ -1,73 +0,0 @@
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* A function library for adding text animators on top of text layers
|
||||
*
|
||||
* @author Kyle Harter
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
var KMTextAnimatorsLib = (function(){
|
||||
|
||||
var matchNames = {
|
||||
animator: "ADBE Text Animator",
|
||||
|
||||
props: {
|
||||
anchorPoint: "ADBE Text Anchor Point 3D" ,
|
||||
position: "ADBE Text Position 3D" ,
|
||||
scale: "ADBE Text Scale 3D" ,
|
||||
skew: "ADBE Text Skew" ,
|
||||
skewAxis: "ADBE Text Skew Axis" ,
|
||||
rotation: "ADBE Text Rotation",
|
||||
opacity: "ADBE Text Opacity"
|
||||
},
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* adds a text animator group to a text layer along with a range selector
|
||||
*
|
||||
* @param {TextLayer} textLayer
|
||||
* @param {string} animator - matchNames.animatorName
|
||||
* @return {Property} the added text animation property
|
||||
*/
|
||||
function addBasicAnimator(textLayer, animator){
|
||||
var anim = textLayer.property("ADBE Text Properties")
|
||||
.property("ADBE Text Animators")
|
||||
.addProperty(animator);
|
||||
|
||||
|
||||
var selector = anim.property("ADBE Text Selectors").addProperty("ADBE Text Selector");
|
||||
|
||||
return anim
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* adds a text animator property to a text animator group
|
||||
*
|
||||
* @param {object} anim - the text animator group established in "addBasicAnimator(textLayer,animator)"
|
||||
* @param {string} prop - matchNames.propName
|
||||
* @return {Property} added text animator property
|
||||
*/
|
||||
function addAnimProp(anim,prop){
|
||||
var animPosGroup = anim.property("ADBE Text Animator Properties");
|
||||
var textAnimProp = animPosGroup.addProperty(prop);
|
||||
return textAnimProp
|
||||
}
|
||||
|
||||
|
||||
|
||||
return {
|
||||
matchNames: matchNames,
|
||||
addBasicAnimator: addBasicAnimator,
|
||||
addAnimProp: addAnimProp
|
||||
};
|
||||
}());
|
||||
|
||||
@@ -1,316 +0,0 @@
|
||||
//@include "./OS.jsx"
|
||||
|
||||
var kmUtilityFunctions = (function (){
|
||||
|
||||
/**
|
||||
* A function that will convert a file into a binary string. Useful fo displaying images in script UI
|
||||
* @function getBinaryFile
|
||||
* @return {File}
|
||||
*/
|
||||
function fileToBinaryString() {
|
||||
|
||||
var input = File.openDialog("choose a file to convert to source code");//new File("path/to/my/file")
|
||||
if (input === null) return;
|
||||
|
||||
var rawData = readBinaryFile(input);
|
||||
var variableName = stringToValidVariableName(input.name);
|
||||
var sourceCode = convertRawDataToSourceCode(rawData, variableName);
|
||||
writeTextFile(input.fsName + ".jsx", sourceCode);
|
||||
|
||||
|
||||
function convertRawDataToSourceCode(rawData, variableName) {
|
||||
var contentAsString = rawData.toSource();
|
||||
var sourceCode = "var " + variableName + " = " + contentAsString + ";\n";
|
||||
return sourceCode;
|
||||
};
|
||||
|
||||
function readBinaryFile(file) {
|
||||
file.encoding = "BINARY";
|
||||
file.open("r");
|
||||
var content = file.read();
|
||||
file.close();
|
||||
return content;
|
||||
};
|
||||
|
||||
function writeTextFile(filePath, content) {
|
||||
var output = new File(filePath);
|
||||
output.open("w");
|
||||
output.encoding = "UTF-8";
|
||||
output.write(sourceCode);
|
||||
output.close();
|
||||
alert("Success!\rYou're jsx file is located here:\r\r" + output.fsName);
|
||||
var binaryLocation = output.parent;
|
||||
binaryLocation.execute();
|
||||
};
|
||||
|
||||
function stringToValidVariableName(string) {
|
||||
return string.replace(/\W/g, "") // remove anything that is not letter, digit or _
|
||||
.replace(/^\d+/, ""); // remove any digits at the beginning
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A function to load CSV data and bring in data from an array
|
||||
*
|
||||
* @param {object} options - Encoding object to determing encoding type. Acceptable keys are 'encoding' or 'separatorSymbol'. Ex:{encoding: "ascii", separatorSymbol: ;};
|
||||
* @return {Array} - CSV Data from a chosen CSV file
|
||||
*/
|
||||
function loadCSVFromFile(options){
|
||||
var file = File.openDialog("Select a .CSV file to parse data from")
|
||||
function parseCSVString(csvString, options){
|
||||
options = options || {};
|
||||
var separatorSymbol = options.separatorSymbol || ",";
|
||||
|
||||
var currentRow = 0;
|
||||
var currentColumn = -1; // will be increased to 0 during first loop iteration
|
||||
var thisCell = "";
|
||||
var i;
|
||||
var token;
|
||||
var cellStart = true;
|
||||
var insideQuote;
|
||||
|
||||
function nextTokenLookAhead(){
|
||||
var nextTokenId = i + 1;
|
||||
return (nextTokenId <csvString.length ? csvString[nextTokenId]:"")
|
||||
}
|
||||
|
||||
function processLineBreaks(){
|
||||
addCsvCellToData(thisCell, currentRow, currentColumn);
|
||||
cellStart = true;
|
||||
currentRow++;
|
||||
currentColumn = -1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
function processCellStart(){
|
||||
|
||||
thisCell = "";
|
||||
currentColumn++;
|
||||
insideQuote = (token == '"');
|
||||
if(insideQuote){
|
||||
i++;
|
||||
token = csvString[i]
|
||||
}
|
||||
|
||||
if(!insideQuote){
|
||||
thisCell += token;
|
||||
}
|
||||
|
||||
cellStart = false;
|
||||
}
|
||||
|
||||
for (i=0; i< csvString.length; i++){
|
||||
token = csvString[i];
|
||||
if(cellStart){
|
||||
processCellStart();
|
||||
}
|
||||
|
||||
else if(!insideQuote && token == separatorSymbol){
|
||||
addCsvCellToData(thisCell, currentRow, currentColumn);
|
||||
cellStart = true;
|
||||
|
||||
}
|
||||
|
||||
else if(!insideQuote && token == "\n"){
|
||||
processLineBreaks()
|
||||
}
|
||||
|
||||
else if(!insideQuote && token == "\r" && nextTokenLookAhead() == "\n"){
|
||||
i++;
|
||||
processLineBreaks();
|
||||
}
|
||||
else if(insideQuote && token == '"'){
|
||||
if(nextTokenLookAhead() == '"'){
|
||||
i++;
|
||||
thisCell += '"';
|
||||
}
|
||||
else {
|
||||
insideQuote = false;
|
||||
}
|
||||
}
|
||||
else {
|
||||
thisCell += token;
|
||||
}
|
||||
}
|
||||
return data
|
||||
|
||||
};
|
||||
|
||||
function addCsvCellToData(cellData, row, column){
|
||||
if(data == undefined){
|
||||
data = [];
|
||||
}
|
||||
|
||||
if(data[row] == undefined){
|
||||
data[row] = [];
|
||||
}
|
||||
|
||||
data[row][column] = cellData
|
||||
}
|
||||
|
||||
var data;
|
||||
options = options || {}
|
||||
file.encoding = options.encoding || "utf-8";
|
||||
if(!(file.open("r"))){
|
||||
throw new Error("Could not open file: " + file.error) ;
|
||||
}
|
||||
|
||||
var rawData = file.read();
|
||||
file.close();
|
||||
if(file.error != "") throw new Error("Could not read file:" + file.error);
|
||||
|
||||
return parseCSVString(rawData, options);
|
||||
|
||||
};
|
||||
|
||||
/**
|
||||
* reads and parses JSON file from supplied file path on disk
|
||||
* @function readJSONFile()
|
||||
* @param {string} filePath - file path to local JSON path
|
||||
* @return {Array} Array of values from external JSON file
|
||||
*/
|
||||
function readJSONFile(filePath){
|
||||
var file = new File(filePath);
|
||||
if(!file.exists) return null;
|
||||
|
||||
file.open('r');
|
||||
var content = file.read();
|
||||
file.close();
|
||||
|
||||
try {
|
||||
return JSON.parse(content);
|
||||
} catch (err){
|
||||
alert("JSON parse error: " + err);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param {String} filePath - OS specific file path
|
||||
* @param {Object} obj -
|
||||
* @return {Boolean} true or false
|
||||
*/
|
||||
function writeJSON(filePath, obj){
|
||||
var file = new File(filePath);
|
||||
if(!file.parent.exists){
|
||||
file.parent.create();
|
||||
}
|
||||
|
||||
if(!file.open("w")){
|
||||
alert("Could not open JSON file for writing");
|
||||
return false
|
||||
}
|
||||
|
||||
file.write(JSON.stringify(obj, null, 2));
|
||||
file.close();
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param {String} filePath - OS specific file path
|
||||
* @param {String} key - unique name given to name of array in the main object
|
||||
* @param {Array} value - collection of items to be added to JSON file
|
||||
* @return {Object} JSON data from file
|
||||
*/
|
||||
function updateJSON(filePath, key, value){
|
||||
var data = readJSON(filePath);
|
||||
|
||||
data[key] = value;
|
||||
writeJSON(filePath, data);
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param {String} filePath - OS specific file path
|
||||
* @param {Object} updates - key value pairs
|
||||
* @return {Object} JSON data from file
|
||||
*/
|
||||
function updateJSONBatch(filePath, updates){
|
||||
var data = readJSON(filePath);
|
||||
|
||||
for(var key in updates){
|
||||
data[key] = updates[key];
|
||||
}
|
||||
|
||||
writeJSON(filePath, data);
|
||||
return data;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* removes trailing characters from file names
|
||||
*
|
||||
* @function removeTrailingCharacters
|
||||
* @param {String} fileName - file system name of a file
|
||||
* @param {Extension} extension - a file extension you're wanting to find and replace trailing characters. DO NOT INCLUDE the period "." in the parameter
|
||||
* @return {String} an amended file name without
|
||||
*/
|
||||
function removeTrailingCharacters(fileName, extension) {
|
||||
return fileName.replace(/\.extenstion\d+$/i, "." + extension.toSring());
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* gets all AE script files with either a jsx or jsxbin file extension
|
||||
* @function getScriptFiles
|
||||
* @param {String} path - valid folder path location
|
||||
* @return {Object} - a JSON object composed of script fs names
|
||||
*/
|
||||
function getScriptFiles(path){
|
||||
var folder = Folder(path);
|
||||
if(folder.exists){
|
||||
var files = folder.getFiles();
|
||||
}
|
||||
|
||||
var scriptFiles = [];
|
||||
for(var i=0; i<files.length; i++){
|
||||
var file = files[i];
|
||||
if(file.name.indexOf("jsx") !== -1 || file.name.indexOf("jsxbin") !== -1){
|
||||
scriptFiles.push(file.fsName)
|
||||
}
|
||||
}
|
||||
|
||||
return JSON.stringify(scriptFiles);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A function that will eval a script file given a valid FS string
|
||||
*
|
||||
* @function runScript
|
||||
* @param {String} scriptPath - a valid file path derived from fsName
|
||||
*/
|
||||
function runScript(scriptPath){
|
||||
var scriptFile = File(scriptPath);
|
||||
$.evalFile(scriptFile);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
return {
|
||||
fileToBinaryString: fileToBinaryString,
|
||||
loadCSVFromFile: loadCSVFromFile,
|
||||
readJSONFile: readJSONFile,
|
||||
writeJSON: writeJSON,
|
||||
updateJSON: updateJSON,
|
||||
removeTrailingCharacters: removeTrailingCharacters,
|
||||
getScriptFiles: getScriptFiles,
|
||||
runScript: runScript
|
||||
};
|
||||
}());
|
||||
@@ -1,14 +0,0 @@
|
||||
//@include "binaryFile.jsx"
|
||||
//@include "filePath.jsx"
|
||||
|
||||
function getUiImage(fileName, toolName,rawData){
|
||||
|
||||
var filePath = getImagePath(fileName, toolName);
|
||||
var file = getBinaryFile(filePath, rawData);
|
||||
return file;
|
||||
|
||||
function getImagePath(fileName, toolName){
|
||||
var filePath = joinPath([getUserDataFolderPath(), toolName, fileName]);
|
||||
return filePath;
|
||||
};
|
||||
};
|
||||
@@ -1,246 +0,0 @@
|
||||
({
|
||||
"Audio Bit Depth": {type: "int", enums: {
|
||||
"8 Bit": 1,
|
||||
"16 Bit": 2,
|
||||
"32 Bit": 4
|
||||
},
|
||||
"enums-reverse": {
|
||||
1: "8 Bit",
|
||||
2: "16 Bit",
|
||||
4: "32 Bit"
|
||||
}, range: [
|
||||
1,
|
||||
4
|
||||
]
|
||||
},
|
||||
"Audio Channels": {type: "int", enums: {Mono: 1, Stereo: 2
|
||||
},
|
||||
"enums-reverse": {
|
||||
1: "Mono",
|
||||
2: "Stereo"
|
||||
}, range: [
|
||||
1,
|
||||
2
|
||||
]
|
||||
},
|
||||
"Audio Sample Rate": {type: "int", enums: {
|
||||
"8.000 kHz": 8000,
|
||||
"11.025 kHz": 11025,
|
||||
"16.000 kHz": 16000,
|
||||
"22.050 kHz": 22050,
|
||||
"24.000 kHz": 24000,
|
||||
"32.000 kHz": 32000,
|
||||
"44.100 kHz": 44100,
|
||||
"48.000 kHz": 48000
|
||||
},
|
||||
"enums-reverse": {
|
||||
8000: "8.000 kHz",
|
||||
11025: "11.025 kHz",
|
||||
16000: "16.000 kHz",
|
||||
22050: "22.050 kHz",
|
||||
24000: "24.000 kHz",
|
||||
32000: "32.000 kHz",
|
||||
44100: "44.100 kHz",
|
||||
48000: "48.000 kHz"
|
||||
}, range: [
|
||||
8000,
|
||||
48000
|
||||
]
|
||||
}, Channels: {type: "int", enums: {RGB: 0,
|
||||
"RGB + Alpha": 1, Alpha: 2
|
||||
},
|
||||
"enums-reverse": {
|
||||
0: "RGB",
|
||||
1: "RGB + Alpha",
|
||||
2: "Alpha"
|
||||
}, range: [
|
||||
0,
|
||||
2
|
||||
]
|
||||
}, Color: {type: "int", enums: {
|
||||
"Straight (Unmatted)": 0,
|
||||
"Premultiplied (Matted)": 1
|
||||
},
|
||||
"enums-reverse": {
|
||||
0: "Straight (Unmatted)",
|
||||
1: "Premultiplied (Matted)"
|
||||
}, range: [
|
||||
0,
|
||||
1
|
||||
]
|
||||
}, Crop: {type: "bool"
|
||||
},
|
||||
"Crop Bottom": {type: "int"
|
||||
},
|
||||
"Crop Left": {type: "int"
|
||||
},
|
||||
"Crop Right": {type: "int"
|
||||
},
|
||||
"Crop Top": {type: "int"
|
||||
}, Depth: {type: "int", enums: {
|
||||
"Floating Point Gray": -32,
|
||||
"256 Colors": 8,
|
||||
"Millions of Colors": 24,
|
||||
"Millions of Colors+": 32,
|
||||
"256 Grays": 40,
|
||||
"Trillions of Colors": 48,
|
||||
"Trillions of Colors+": 64,
|
||||
"Floating Point": 96,
|
||||
"Floating Point+": 128
|
||||
},
|
||||
"enums-reverse": {
|
||||
-32: "Floating Point Gray",
|
||||
8: "256 Colors",
|
||||
24: "Millions of Colors",
|
||||
32: "Millions of Colors+",
|
||||
40: "256 Grays",
|
||||
48: "Trillions of Colors",
|
||||
64: "Trillions of Colors+",
|
||||
96: "Floating Point",
|
||||
128: "Floating Point+"
|
||||
}, range: [
|
||||
-32,
|
||||
128
|
||||
]
|
||||
}, Format: {type: "int", enums: {AIFF: 0,
|
||||
"DPX/Cineon Sequence": 1,
|
||||
"H.264": 2,
|
||||
"IFF Sequence": 3,
|
||||
"JPEG Sequence": 4, MP3: 5,
|
||||
"OpenEXR Sequence": 6,
|
||||
"PNG Sequence": 7,
|
||||
"Photoshop Sequence": 8, QuickTime: 9,
|
||||
"Quicktime NotchLC Format": 10,
|
||||
"Radiance Sequence": 11,
|
||||
"SGI Sequence": 12,
|
||||
"TIFF Sequence": 13,
|
||||
"Targa Sequence": 14, WAV: 15
|
||||
},
|
||||
"enums-reverse": {
|
||||
0: "AIFF",
|
||||
1: "DPX/Cineon Sequence",
|
||||
2: "H.264",
|
||||
3: "IFF Sequence",
|
||||
4: "JPEG Sequence",
|
||||
5: "MP3",
|
||||
6: "OpenEXR Sequence",
|
||||
7: "PNG Sequence",
|
||||
8: "Photoshop Sequence",
|
||||
9: "QuickTime",
|
||||
10: "Quicktime NotchLC Format",
|
||||
11: "Radiance Sequence",
|
||||
12: "SGI Sequence",
|
||||
13: "TIFF Sequence",
|
||||
14: "Targa Sequence",
|
||||
15: "WAV"
|
||||
}, range: [
|
||||
0,
|
||||
15
|
||||
]
|
||||
},
|
||||
"Include Project Link": {type: "bool"
|
||||
},
|
||||
"Include Source XMP Metadata": {type: "bool"
|
||||
},
|
||||
"Lock Aspect Ratio": {type: "bool"
|
||||
},
|
||||
"Output Audio": {type: "int", enums: {Off: 1, On: 2, Auto: 3
|
||||
},
|
||||
"enums-reverse": {
|
||||
1: "Off",
|
||||
2: "On",
|
||||
3: "Auto"
|
||||
}, range: [
|
||||
1,
|
||||
3
|
||||
]
|
||||
},
|
||||
"Output File Info": {type: {
|
||||
"Full Flat Path": "string",
|
||||
"Base Path": "string",
|
||||
"Subfolder Path": "string",
|
||||
"File Name": "string",
|
||||
"File Template": "string"
|
||||
}
|
||||
},
|
||||
"Post-Render Action": {type: "int", enums: {None: 0, Import: 1,
|
||||
"Import & Replace Usage": 2,
|
||||
"Set Proxy": 3
|
||||
},
|
||||
"enums-reverse": {
|
||||
0: "None",
|
||||
1: "Import",
|
||||
2: "Import & Replace Usage",
|
||||
3: "Set Proxy"
|
||||
}, range: [
|
||||
0,
|
||||
3
|
||||
]
|
||||
}, Resize: {type: "bool"
|
||||
},
|
||||
"Resize Quality": {type: "int", enums: {Low: 0, High: 1
|
||||
},
|
||||
"enums-reverse": {
|
||||
0: "Low",
|
||||
1: "High"
|
||||
}, range: [
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"Resize to": {type: "{\"x\": <int>, \"y\": <int>}", enums: {
|
||||
"Cineon Full \u2022 3656x2664 \u2022 24 fps": "3656,2664",
|
||||
"Cineon Half \u2022 1828x1332 \u2022 24 fps": "1828,1332", Custom: "x,y", Custom2: "{\"x\": <x_val>, \"y\": <y_val>}", Custom3: "[<x_val>,<y_val>]",
|
||||
"DVCPRO HD \u2022 1280x1080 (1.5) \u2022 29.97 fps": "1280,1080",
|
||||
"DVCPRO HD \u2022 1440x1080 (1.33) \u2022 25 fps": "1440,1080",
|
||||
"DVCPRO HD \u2022 960x720 (1.33) \u2022 23.976 fps": "960,720",
|
||||
"DVCPRO HD \u2022 960x720 (1.33) \u2022 25 fps": "960,720",
|
||||
"DVCPRO HD \u2022 960x720 (1.33) \u2022 29.97 fps": "960,720",
|
||||
"Film (2K) \u2022 2048x1556 \u2022 24 fps": "2048,1556",
|
||||
"Film (4K) \u2022 4096x3112 \u2022 24 fps": "4096,3112",
|
||||
"HD \u2022 1920x1080 \u2022 24 fps": "1920,1080",
|
||||
"HD \u2022 1920x1080 \u2022 25 fps": "1920,1080",
|
||||
"HD \u2022 1920x1080 \u2022 29.97 fps": "1920,1080",
|
||||
"HDV \u2022 1440x1080 (1.33) \u2022 25 fps": "1440,1080",
|
||||
"HDV \u2022 1440x1080 (1.33) \u2022 29.97 fps": "1440,1080",
|
||||
"HDV/HDTV \u2022 1280x720 \u2022 25 fps": "1280,720",
|
||||
"HDV/HDTV \u2022 1280x720 \u2022 29.97 fps": "1280,720",
|
||||
"Social Media Landscape \u2022 1280x720 \u2022 30 fps": "1280,720",
|
||||
"Social Media Landscape HD \u2022 1920x1080 \u2022 30 fps": "1920,1080",
|
||||
"Social Media Portrait \u2022 720x1280 \u2022 30 fps": "720,1280",
|
||||
"Social Media Portrait HD \u2022 1080x1920 \u2022 30 fps": "1080,1920",
|
||||
"Social Media Square \u2022 1080x1080 \u2022 30 fps": "1080,1080",
|
||||
"UHD (4K) \u2022 3840x2160 \u2022 23.976 fps": "3840,2160",
|
||||
"UHD (4K) \u2022 3840x2160 \u2022 25 fps": "3840,2160",
|
||||
"UHD (4K) \u2022 3840x2160 \u2022 29.97 fps": "3840,2160",
|
||||
"UHD (8K) \u2022 7680x4320 \u2022 23.976 fps": "7680,4320"
|
||||
},
|
||||
"enums-reverse": {
|
||||
"3656,2664": "Cineon Full • 3656x2664 • 24 fps",
|
||||
"1828,1332": "Cineon Half • 1828x1332 • 24 fps",
|
||||
"x,y": "Custom",
|
||||
"{\"x\": <x_val>, \"y\": <y_val>}": "Custom2",
|
||||
"[<x_val>,<y_val>]": "Custom3",
|
||||
"1280,1080": "DVCPRO HD • 1280x1080 (1.5) • 29.97 fps",
|
||||
"1440,1080": "HDV • 1440x1080 (1.33) • 29.97 fps",
|
||||
"960,720": "DVCPRO HD • 960x720 (1.33) • 29.97 fps",
|
||||
"2048,1556": "Film (2K) • 2048x1556 • 24 fps",
|
||||
"4096,3112": "Film (4K) • 4096x3112 • 24 fps",
|
||||
"1920,1080": "Social Media Landscape HD • 1920x1080 • 30 fps",
|
||||
"1280,720": "Social Media Landscape • 1280x720 • 30 fps",
|
||||
"720,1280": "Social Media Portrait • 720x1280 • 30 fps",
|
||||
"1080,1920": "Social Media Portrait HD • 1080x1920 • 30 fps",
|
||||
"1080,1080": "Social Media Square • 1080x1080 • 30 fps",
|
||||
"3840,2160": "UHD (4K) • 3840x2160 • 29.97 fps",
|
||||
"7680,4320": "UHD (8K) • 7680x4320 • 23.976 fps"
|
||||
}
|
||||
},
|
||||
"Starting #": {type: "int"
|
||||
},
|
||||
"Use Comp Frame Number": {type: "bool"
|
||||
},
|
||||
"Use Region of Interest": {type: "bool"
|
||||
},
|
||||
"Video Output": {type: "bool"
|
||||
}
|
||||
})
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,202 +0,0 @@
|
||||
(
|
||||
{
|
||||
"3:2 Pulldown": {type: "int", enums: {Off: 0, WSSWW: 1, SSWWW: 2, SWWWS: 3, WWWSS: 4, WWSSW: 5
|
||||
},
|
||||
"enums-reverse": {
|
||||
0: "Off",
|
||||
1: "WSSWW",
|
||||
2: "SSWWW",
|
||||
3: "SWWWS",
|
||||
4: "WWWSS",
|
||||
5: "WWSSW"
|
||||
}, range: [
|
||||
0,
|
||||
5
|
||||
]
|
||||
},
|
||||
"Color Depth": {type: "int", enums: {
|
||||
"Current Settings": -1,
|
||||
"8 bits per channel": 0,
|
||||
"16 bits per channel": 1,
|
||||
"32 bits per channel": 2
|
||||
},
|
||||
"enums-reverse": {
|
||||
-1: "Current Settings",
|
||||
0: "8 bits per channel",
|
||||
1: "16 bits per channel",
|
||||
2: "32 bits per channel"
|
||||
}, range: [
|
||||
-1,
|
||||
2
|
||||
]
|
||||
},
|
||||
"Disk Cache": {type: "int", enums: {
|
||||
"Read Only": 0,
|
||||
"Current Settings": 2
|
||||
},
|
||||
"enums-reverse": {
|
||||
0: "Read Only",
|
||||
2: "Current Settings"
|
||||
}, range: [
|
||||
0,
|
||||
2
|
||||
]
|
||||
}, Effects: {type: "int", enums: {
|
||||
"All Off": 0,
|
||||
"All On": 1,
|
||||
"Current Settings": 2
|
||||
},
|
||||
"enums-reverse": {
|
||||
0: "All Off",
|
||||
1: "All On",
|
||||
2: "Current Settings"
|
||||
}, range: [
|
||||
0,
|
||||
2
|
||||
]
|
||||
},
|
||||
"Field Render": {type: "int", enums: {Off: 0,
|
||||
"Upper Field First": 1,
|
||||
"Lower Field First": 2
|
||||
},
|
||||
"enums-reverse": {
|
||||
0: "Off",
|
||||
1: "Upper Field First",
|
||||
2: "Lower Field First"
|
||||
}, range: [
|
||||
0,
|
||||
2
|
||||
]
|
||||
},
|
||||
"Frame Blending": {type: "int", enums: {
|
||||
"Off for All Layers": 0,
|
||||
"On for Checked Layers": 1,
|
||||
"Current Settings": 2
|
||||
},
|
||||
"enums-reverse": {
|
||||
0: "Off for All Layers",
|
||||
1: "On for Checked Layers",
|
||||
2: "Current Settings"
|
||||
}, range: [
|
||||
0,
|
||||
2
|
||||
]
|
||||
},
|
||||
"Frame Rate": {type: "int", enums: {
|
||||
"Use comp's frame rate": 0,
|
||||
"Use this frame rate": 1
|
||||
},
|
||||
"enums-reverse": {
|
||||
0: "Use comp's frame rate",
|
||||
1: "Use this frame rate"
|
||||
}, range: [
|
||||
0,
|
||||
1
|
||||
]
|
||||
},
|
||||
"Guide Layers": {type: "int", enums: {
|
||||
"All Off": 0,
|
||||
"Current Settings": 2
|
||||
},
|
||||
"enums-reverse": {
|
||||
0: "All Off",
|
||||
2: "Current Settings"
|
||||
}, range: [
|
||||
0,
|
||||
2
|
||||
]
|
||||
},
|
||||
"Motion Blur": {type: "int", enums: {
|
||||
"Off for All Layers": 0,
|
||||
"On for Checked Layers": 1,
|
||||
"Current Settings": 2
|
||||
},
|
||||
"enums-reverse": {
|
||||
0: "Off for All Layers",
|
||||
1: "On for Checked Layers",
|
||||
2: "Current Settings"
|
||||
}, range: [
|
||||
0,
|
||||
2
|
||||
]
|
||||
},
|
||||
"Proxy Use": {type: "int", enums: {
|
||||
"Use No Proxies": 0,
|
||||
"Use All Proxies": 1,
|
||||
"Current Settings": 2,
|
||||
"Use Comp Proxies Only": 3
|
||||
},
|
||||
"enums-reverse": {
|
||||
0: "Use No Proxies",
|
||||
1: "Use All Proxies",
|
||||
2: "Current Settings",
|
||||
3: "Use Comp Proxies Only"
|
||||
}, range: [
|
||||
0,
|
||||
3
|
||||
]
|
||||
}, Quality: {type: "int", enums: {
|
||||
"Current Settings": -1, Wireframe: 0, Draft: 1, Best: 2
|
||||
},
|
||||
"enums-reverse": {
|
||||
-1: "Current Settings",
|
||||
0: "Wireframe",
|
||||
1: "Draft",
|
||||
2: "Best"
|
||||
}, range: [
|
||||
-1,
|
||||
2
|
||||
]
|
||||
}, Resolution: {type: "{\"x\": <int>, \"y\": <int>}", enums: {
|
||||
"Current Settings": "0,0", Custom: "x,y", Custom2: "{\"x\": <x_val>, \"y\": <y_val>}", Custom3: "[<x_val>,<y_val>]", Full: "1,1", Half: "2,2", Quarter: "4,4", Third: "3,3"
|
||||
},
|
||||
"enums-reverse": {
|
||||
"0,0": "Current Settings",
|
||||
"x,y": "Custom",
|
||||
"{\"x\": <x_val>, \"y\": <y_val>}": "Custom2",
|
||||
"[<x_val>,<y_val>]": "Custom3",
|
||||
"1,1": "Full",
|
||||
"2,2": "Half",
|
||||
"4,4": "Quarter",
|
||||
"3,3": "Third"
|
||||
}
|
||||
},
|
||||
"Skip Existing Files": {type: "bool"
|
||||
},
|
||||
"Solo Switches": {type: "int", enums: {
|
||||
"All Off": 0,
|
||||
"Current Settings": 2
|
||||
},
|
||||
"enums-reverse": {
|
||||
0: "All Off",
|
||||
2: "Current Settings"
|
||||
}, range: [
|
||||
0,
|
||||
2
|
||||
]
|
||||
},
|
||||
"Time Span": {type: "int", enums: {
|
||||
"Length of Comp": 0,
|
||||
"Work Area Only": 1, Custom: 2
|
||||
},
|
||||
"enums-reverse": {
|
||||
0: "Length of Comp",
|
||||
1: "Work Area Only",
|
||||
2: "Custom"
|
||||
}, range: [
|
||||
0,
|
||||
2
|
||||
]
|
||||
},
|
||||
"Time Span Duration": {type: "double"
|
||||
},
|
||||
"Time Span End": {type: "double"
|
||||
},
|
||||
"Time Span Start": {type: "double"
|
||||
},
|
||||
"Use comp's frame rate": {type: "double"
|
||||
},
|
||||
"Use this frame rate": {type: "double"
|
||||
}
|
||||
}
|
||||
)
|
||||
@@ -1,111 +0,0 @@
|
||||
/**
|
||||
* @description a headless script to do something cool in AE
|
||||
* @name km-create-accelerate-pixel-map
|
||||
* @author Kyle Harter <kylenmotion@gmail.com>
|
||||
* @version 1.0.0
|
||||
*
|
||||
* @license This script is provided "as is," without warranty of any kind, expressed or implied. In
|
||||
* no event shall the author be held liable for any damages arising in any way from the use of this
|
||||
* script.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
(function () {
|
||||
//@include "../library/km_helperFunctions.jsx";
|
||||
//@include "../library/km_scriptUI_functions.jsx";
|
||||
//@include "../library/km_utilityFunctions.jsx";
|
||||
//@include "../library/km_textAnimators.jsx";
|
||||
//@include "../library/km_systemFunctions.jsx";
|
||||
try {
|
||||
app.beginUndoGroup("Create's pixel map for accelerate 2026");
|
||||
var km = kmFunction;
|
||||
var kmScript = kmScriptUI;
|
||||
var kmUtils = kmUtilityFunctions;
|
||||
var kmTextAnims = KMTextAnimatorsLib;
|
||||
var kmSystems = kmSystemsLib;
|
||||
|
||||
var proj = km.getProj();
|
||||
if(!proj) return;
|
||||
var activeComp = km.getActiveComp(proj);
|
||||
if(!activeComp) return
|
||||
|
||||
|
||||
var pixelMapData = [
|
||||
{header: {
|
||||
size: [9120,320],
|
||||
fillColor: [.97,.07,68],
|
||||
position: [0,-640]
|
||||
}},
|
||||
{hlOuter: {
|
||||
size: [2240,1280],
|
||||
fillColor: [.47,.14,.65],
|
||||
position: [-4240,160]
|
||||
}},
|
||||
{hrOuter: {
|
||||
size: [2240,1280],
|
||||
fillColor: [.47,.14,.65],
|
||||
position: [4240,160]
|
||||
}},
|
||||
{center: {
|
||||
size: [6240,1280],
|
||||
position: [0,160],
|
||||
fillColor: [.01,.47,1]
|
||||
}},
|
||||
]
|
||||
|
||||
var canvasName = 'PIXEL MAP'
|
||||
buildCanvas(activeComp, canvasName, pixelMapData);
|
||||
|
||||
|
||||
} catch (error) {
|
||||
alert(
|
||||
"An error occured on line: " +
|
||||
error.line +
|
||||
"\nError message: " +
|
||||
error.message,
|
||||
);
|
||||
} finally {
|
||||
// this always runs no matter what
|
||||
app.endUndoGroup();
|
||||
}
|
||||
|
||||
|
||||
|
||||
function buildCanvas(comp, name, data) {
|
||||
var canvasShape = comp.layers.addShape();
|
||||
canvasShape.name = name;
|
||||
canvasShape.guideLayer = true;
|
||||
|
||||
for(var i = 0; i< data.length; i++){
|
||||
var screen = data[i];
|
||||
for(var key in screen){
|
||||
var shapeRoot = canvasShape.property('ADBE Root Vectors Group');
|
||||
var screenGroup = shapeRoot.addProperty('ADBE Vector Group');
|
||||
screenGroup.name = Object.keys(screen)[0];
|
||||
var screenContents = screenGroup.property('ADBE Vectors Group');
|
||||
var rectGroup = screenContents.addProperty('ADBE Vector Group');
|
||||
rectGroup.name = screenGroup.name + '-shape-group'
|
||||
var rectContents = rectGroup.property('ADBE Vectors Group');
|
||||
var screenShape = rectContents.addProperty('ADBE Vector Shape - Rect');
|
||||
var screenSize = screenShape.property('ADBE Vector Rect Size');
|
||||
screenSize.setValue(screen[key].size);
|
||||
|
||||
var fillParentProperty = rectContents.addProperty('ADBE Vector Graphic - Fill');
|
||||
var fillColorProp = fillParentProperty.property('ADBE Vector Fill Color');
|
||||
fillColorProp.setValue(screen[key].fillColor)
|
||||
|
||||
var shapeTransformGroup = rectGroup.property('ADBE Vector Transform Group');
|
||||
var shapeTransformPos = shapeTransformGroup.property('ADBE Vector Position');
|
||||
shapeTransformPos.setValue(screen[key].position);
|
||||
}
|
||||
}
|
||||
|
||||
var canvasTransform = canvasShape.property('ADBE Transform Group');
|
||||
canvasTransform.property('ADBE Opacity').setValue(15);
|
||||
|
||||
return;
|
||||
}
|
||||
})();
|
||||
@@ -1,106 +0,0 @@
|
||||
/**
|
||||
* @description a script wiyh a UI that will do something really cool in AE
|
||||
* @name km-scriptname
|
||||
* @author Kyle Harter <kylenmotion@gmail.com>
|
||||
* @version 1.0.0
|
||||
*
|
||||
* @license This script is provided "as is," without warranty of any kind, expressed or implied. In
|
||||
* no event shall the author be held liable for any damages arising in any way from the use of this
|
||||
* script.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
(function(thisObj){
|
||||
|
||||
//@include "../library/km_helperFunctions.jsx";
|
||||
//@include "../library/km_scriptUI_functions.jsx";
|
||||
//@include "../library/km_utilityFunctions.jsx";
|
||||
//@include "../library/km_textAnimators.jsx";
|
||||
//@include "../library/km_systemFunctions.jsx";
|
||||
|
||||
var scriptName = "Script Name";
|
||||
|
||||
createUI(thisObj)
|
||||
|
||||
function createUI(thisObj){
|
||||
var win = thisObj instanceof Panel
|
||||
? thisObj
|
||||
: new Window("window", scriptName, undefined, {
|
||||
resizeable: true
|
||||
})
|
||||
|
||||
win.orientation = 'column';
|
||||
win.alignChildren = ["left", "top"];
|
||||
|
||||
var mainGroup = win.add("group", undefined, "Main Group");
|
||||
mainGroup.orientation = 'column';
|
||||
|
||||
var applyGroup = mainGroup.add("group", undefined, "Apply Group");
|
||||
applyGroup.orientation = 'row';
|
||||
var applyButton = applyGroup.add("button", undefined, "Apply");
|
||||
applyButton.preferredSize = [-1,30];
|
||||
applyButton.helpTip = "Click: Apply markers to selected layers.\rShift+Click: Apply markers to beginning of a comp."
|
||||
|
||||
|
||||
applyButton.onClick = function(){
|
||||
try {
|
||||
app.beginUndoGroup("What script does");
|
||||
|
||||
var km = kmFunction;
|
||||
var kmScript = kmScriptUI;
|
||||
var kmUtils = kmUtilityFunctions;
|
||||
var kmTextAnims = KMTextAnimatorsLib;
|
||||
|
||||
var comp = km.getActiveComp(app.project);
|
||||
var selLayers = km.getSelectedLayers(comp);
|
||||
var selProp = km.getSelectedProperties(selLayers)[0];
|
||||
|
||||
alert(getPropertyPath(selLayers[0],selProp))
|
||||
|
||||
} catch(error) {
|
||||
alert("An error occured on line: " + error.line + "\nError message: " + error.message);
|
||||
} finally {
|
||||
// this always runs no matter what
|
||||
app.endUndoGroup()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function getPropertyPath(layer,selProp){
|
||||
var propDepth = selProp.propertyDepth;
|
||||
var props = ['(\'' + selProp.name + '\')'];
|
||||
var containing_layer = selProp.propertyGroup(selProp.propertyDepth);
|
||||
for(var i = 1; i<propDepth; i++){
|
||||
var prop = selProp.propertyGroup(i);
|
||||
props.unshift('(\'' + prop.name + '\')')
|
||||
}
|
||||
|
||||
var finalPropPathString = 'thisComp.layer(\''+layer.name+ '\')'+ props.join('');
|
||||
|
||||
return finalPropPathString
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
win.onResizing = win.onResize = function (){
|
||||
this.layout.resize();
|
||||
};
|
||||
|
||||
if(win instanceof Window){
|
||||
win.center();
|
||||
win.show();
|
||||
} else {
|
||||
win.layout.layout(true);
|
||||
win.layout.resize();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}(this))
|
||||
@@ -1,115 +0,0 @@
|
||||
/**
|
||||
* @description a headless script to do something cool in AE
|
||||
* @name km-scriptname
|
||||
* @author Kyle Harter <kylenmotion@gmail.com>
|
||||
* @version 1.0.0
|
||||
*
|
||||
* @license This script is provided "as is," without warranty of any kind, expressed or implied. In
|
||||
* no event shall the author be held liable for any damages arising in any way from the use of this
|
||||
* script.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
(function () {
|
||||
//@include "../library/km_helperFunctions.jsx";
|
||||
//@include "../library/km_scriptUI_functions.jsx";
|
||||
//@include "../library/km_utilityFunctions.jsx";
|
||||
//@include "../library/km_textAnimators.jsx";
|
||||
//@include "../library/km_systemFunctions.jsx";
|
||||
try {
|
||||
app.beginUndoGroup("what does this script do?");
|
||||
var km = kmFunction;
|
||||
var kmScript = kmScriptUI;
|
||||
var kmUtils = kmUtilityFunctions;
|
||||
var kmTextAnims = KMTextAnimatorsLib;
|
||||
var kmSystems = kmSystemsLib;
|
||||
|
||||
var activeComp = km.getActiveComp(app.project);
|
||||
if(!activeComp) return
|
||||
var selLayers = km.getSelectedLayers(activeComp);
|
||||
if(!selLayers) return
|
||||
var selProps = km.getSelectedProperties(selLayers);
|
||||
if(!selProps) return
|
||||
var posProps = getPositionProps(selProps);
|
||||
|
||||
var alertMessage = 'Keyframe Stats\r';
|
||||
|
||||
for(var m = 0; m<posProps.length; m++){
|
||||
var posProp = posProps[m];
|
||||
var easeInfo = [];
|
||||
for(var e = 0; e<posProp.propEases.length; e++){
|
||||
var ease = posProp.propEases[e];
|
||||
for(var field in ease){
|
||||
easeInfo.push(field + ': ' + ease[field])
|
||||
}
|
||||
}
|
||||
alertMessage +=
|
||||
'Property Name: ' + posProp.propName +
|
||||
'\rProperty Num Keys: ' + posProp.propKeys +
|
||||
'\rProperty Eases:\r' + easeInfo.join('\r') + '\r\r'
|
||||
}
|
||||
|
||||
alert(alertMessage)
|
||||
|
||||
} catch (error) {
|
||||
alert(
|
||||
"An error occured on line: " +
|
||||
error.line +
|
||||
"\nError message: " +
|
||||
error.message,
|
||||
);
|
||||
} finally {
|
||||
// this always runs no matter what
|
||||
app.endUndoGroup();
|
||||
}
|
||||
|
||||
|
||||
/* function separateKeysEase(props){
|
||||
|
||||
|
||||
|
||||
} */
|
||||
|
||||
|
||||
function getPositionProps(selProps) {
|
||||
var positionProps = [];
|
||||
var found = false;
|
||||
|
||||
for(var i = 0; i<selProps.length; i++){
|
||||
var prop = selProps[i];
|
||||
var propEases = [];
|
||||
if(prop.matchName == 'ADBE Position'){
|
||||
found = true;
|
||||
if(prop.numKeys > 0){
|
||||
for(var k = 1; k<=prop.numKeys; k++){
|
||||
var key = k;
|
||||
propEases.push({
|
||||
keyVal: prop.keyValue(key),
|
||||
keyTime: prop.keyTime(key),
|
||||
keyInInterpType: prop.keyInInterpolationType(key).speed,
|
||||
keyInSpatialTan: prop.keyInSpatialTangent(key).speed,
|
||||
keyInTempEase: prop.keyInTemporalEase(key).speed,
|
||||
keyOutInterpType: prop.keyOutInterpolationType(key).speed,
|
||||
keyOutSpatialTan: prop.keyOutSpatialTangent(key).speed,
|
||||
keyOutTempEase: prop.keyOutTemporalEase(key).speed,
|
||||
}
|
||||
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
positionProps.push({
|
||||
propName: prop.name,
|
||||
propKeys: prop.numKeys,
|
||||
propEases: propEases
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
return positionProps;
|
||||
}
|
||||
})();
|
||||
@@ -1,818 +0,0 @@
|
||||
/**
|
||||
* @description a script with a UI that will automate rendering process for multiple screens
|
||||
* @name Show Render Helper
|
||||
* @author Kyle Harter <kylenmotion@gmail.com>
|
||||
*
|
||||
* @license This script is provided "as is," without warranty of any kind, expressed or implied. In
|
||||
* no event shall the author be held liable for any damages arising in any way from the use of this
|
||||
* script.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
(function(thisObj){
|
||||
|
||||
//@include "../library/km_helperFunctions.jsx";
|
||||
//@include "../library/km_scriptUI_functions.jsx";
|
||||
//@include "../library/km_utilityFunctions.jsx";
|
||||
//@include "../library/km_textAnimators.jsx";
|
||||
//@include "../library/km_systemFunctions.jsx";
|
||||
//@include "../library/OS.jsx";
|
||||
//@include "../library/json2.js"
|
||||
|
||||
var versionNumber = '0.1.8';
|
||||
var scriptName = "Show Render Helper" + ' v' + versionNumber;
|
||||
|
||||
createUI(thisObj)
|
||||
|
||||
function createUI(thisObj){
|
||||
|
||||
var win = thisObj instanceof Panel
|
||||
? thisObj
|
||||
: new Window("window", scriptName, undefined, {
|
||||
resizeable: true
|
||||
})
|
||||
|
||||
win.orientation = 'column';
|
||||
win.alignChildren = ["fill", "top"];
|
||||
|
||||
var tabMargins = [16,15,16,0];
|
||||
var panelMargins = 16;
|
||||
var separator = getSeparator();
|
||||
|
||||
var proj = null;
|
||||
// if(!proj) return
|
||||
if(app.project){
|
||||
proj = app.project;
|
||||
}
|
||||
|
||||
var defaultFolder = proj && proj.file ? new Folder(proj.file.parent.absoluteURI + '/renders') : Folder.desktop
|
||||
|
||||
var DEFAULT_SETTINGS = {
|
||||
settings:{
|
||||
defaultOutputPath: defaultFolder.absoluteURI,
|
||||
qcExports : true
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
var savedSettings = readSettingsFile();
|
||||
if(savedSettings.settings){
|
||||
for(var key in savedSettings.settings){
|
||||
if(savedSettings.settings.hasOwnProperty(key) && typeof savedSettings.settings !== 'undefined'){
|
||||
DEFAULT_SETTINGS.settings[key] = savedSettings.settings[key]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
var mainTabbedPanel = win.add("tabbedpanel", undefined, undefined);
|
||||
mainTabbedPanel.orientation = 'column';
|
||||
mainTabbedPanel.alignChildren = ['fill', 'fill']
|
||||
// mainTabbedPanel.size = [350,450];
|
||||
|
||||
var renderTab = mainTabbedPanel.add('tab', undefined, 'Render');
|
||||
renderTab.orientation = 'column';
|
||||
renderTab.alignChildren = ['fill', 'top'];
|
||||
renderTab.margins = tabMargins;
|
||||
renderTab.spacing = 10;
|
||||
|
||||
|
||||
// WALLSELECTPANEL
|
||||
// ===============
|
||||
var wallSelectPanel = renderTab.add("panel", undefined, undefined, {name: "wallSelectPanel"});
|
||||
wallSelectPanel.text = "Select Walls";
|
||||
wallSelectPanel.orientation = "column";
|
||||
wallSelectPanel.alignChildren = ["fill","center"];
|
||||
wallSelectPanel.margins = panelMargins;
|
||||
|
||||
// WALLSGROUP
|
||||
// ==========
|
||||
var wallsGroup = wallSelectPanel.add("group", undefined, {name: "wallsGroup"});
|
||||
wallsGroup.orientation = "row";
|
||||
wallsGroup.alignChildren = ["fill","fill"];
|
||||
wallsGroup.spacing = 20;
|
||||
|
||||
// TOPROW
|
||||
// ======
|
||||
var leftColumn = wallsGroup.add("group", undefined, {name: "leftColumn"});
|
||||
leftColumn.orientation = "column";
|
||||
leftColumn.alignChildren = ["left","center"];
|
||||
leftColumn.spacing = 20;
|
||||
|
||||
|
||||
|
||||
var wallA = leftColumn.add("checkbox", undefined, undefined, {name: "wallA"});
|
||||
wallA.text = "A - Left Wall";
|
||||
wallA.value = true;
|
||||
|
||||
var wallC = leftColumn.add("checkbox", undefined, undefined, {name: "wallC"});
|
||||
wallC.text = "C - Right Wall";
|
||||
wallC.value = true;
|
||||
|
||||
// BOTTOMROW
|
||||
// =========
|
||||
var rightColumn = wallsGroup.add("group", undefined, {name: "rightColumn"});
|
||||
rightColumn.orientation = "column";
|
||||
rightColumn.alignment = ['right', 'top'];
|
||||
rightColumn.alignChildren = ["left","center"];
|
||||
rightColumn.spacing = 20;
|
||||
|
||||
var wallB = rightColumn.add("checkbox", undefined, undefined, {name: "wallB"});
|
||||
wallB.text = "B - Center Wall";
|
||||
wallB.value = true;
|
||||
|
||||
var wallD = rightColumn.add("checkbox", undefined, undefined, {name: "wallD"});
|
||||
wallD.text = "D - Header Wall";
|
||||
wallD.value = true;
|
||||
var allWalls = wallSelectPanel.add("checkbox", undefined, undefined, {name: "selectAllWalls"});
|
||||
allWalls.alignment = ['center', 'top'];
|
||||
allWalls.text = "Deselect All Walls";
|
||||
allWalls.value = true;
|
||||
|
||||
// ALPHAROW
|
||||
// ========
|
||||
var utilityPanel = renderTab.add("panel", undefined, 'Utility', {name: "utlityPanel"});
|
||||
utilityPanel.orientation = "row";
|
||||
utilityPanel.alignChildren = ["fill","center"];
|
||||
utilityPanel.margins = panelMargins;
|
||||
|
||||
var wallAlpha = utilityPanel.add("checkbox", undefined, undefined, {name: "wallAlpha"});
|
||||
wallAlpha.text = "Walls on Alpha";
|
||||
var qcExports = utilityPanel.add("checkbox", undefined, undefined);
|
||||
qcExports.text = "QC Exports in AE";
|
||||
qcExports.alignment = ['center', 'center']
|
||||
qcExports.value = DEFAULT_SETTINGS.settings.qcExports;
|
||||
var addToRQ = utilityPanel.add("checkbox", undefined, undefined);
|
||||
addToRQ.text = "Add to Render Queue";
|
||||
addToRQ.alignment = ['right', 'center'];
|
||||
addToRQ.helpTip = 'Adds selected comps to the render queue without starting rendering';
|
||||
|
||||
// OUTPUTPANEL
|
||||
// ===========
|
||||
var locationPanel = renderTab.add("panel", undefined, 'Output Location', {name: "locationPanel"});
|
||||
locationPanel.orientation = "column";
|
||||
locationPanel.alignChildren = ["fill","center"];
|
||||
locationPanel.spacing = 10;
|
||||
locationPanel.margins = panelMargins;
|
||||
|
||||
var locationButton = locationPanel.add("button", undefined, undefined, {name: "locationButton"});
|
||||
locationButton.text = "Choose Location...";
|
||||
var renderLocationText = locationPanel.add("statictext", undefined, undefined, {name: "renderLocationText"});
|
||||
renderLocationText.text = truncateFilePath(Folder.decode(DEFAULT_SETTINGS.settings.defaultOutputPath), separator);
|
||||
renderLocationText.characters = 25;
|
||||
|
||||
|
||||
var renderPanel = renderTab.add('panel', undefined,'');
|
||||
renderPanel.orientation = 'row';
|
||||
renderPanel.alignChildren = ['fill', 'top'];
|
||||
renderPanel.margins = panelMargins;
|
||||
var renderButton = renderPanel.add("button", undefined, 'Render', {name: "renderButton"});
|
||||
//<------ TEST ------->
|
||||
// Button used for spot bug testing to avoid going through entire render process
|
||||
// var testButton = renderPanel.add("button", undefined, 'Test', {name: "renderButton"});
|
||||
|
||||
|
||||
// HELP TAB
|
||||
// ==========
|
||||
var helpTab = mainTabbedPanel.add('tab', undefined, 'Help')
|
||||
helpTab.orientation = 'column';
|
||||
helpTab.alignChildren = ['fill', 'top'];
|
||||
helpTabspacing = 10;
|
||||
helpTab.margins = tabMargins;
|
||||
var helpGroup = helpTab.add('group', undefined, 'Help Group');
|
||||
helpGroup.alignChildren = ['fill', 'top']
|
||||
helpGroup.orientation = 'column';
|
||||
var helpEditText = helpGroup.add('edittext', undefined, undefined,{multiline: true, readonly: true ,scrollable: true});
|
||||
helpEditText.text = 'Help instructions loading';
|
||||
helpEditText.preferredSize.height = 325;
|
||||
// helpEditText.alignment = ['fill', 'fill'];
|
||||
var omButtonGroup = helpTab.add('group', undefined, 'Output Modules Source Button Group');
|
||||
omButtonGroup.orientation = 'row';
|
||||
omButtonGroup.alignChildren = ['fill', 'top'];
|
||||
var omSourceButton = omButtonGroup.add('button', undefined, 'Get Output Modules');
|
||||
// omSourceButton.alignment = ['fill', 'fill'];
|
||||
|
||||
// Settings TAB
|
||||
// ==========
|
||||
var settingsTab = mainTabbedPanel.add('tab', undefined, 'Settings')
|
||||
settingsTab.orientation = 'column';
|
||||
settingsTab.alignChildren = ['fill', 'fill'];
|
||||
settingsTab.margins = tabMargins;
|
||||
|
||||
var settingsGroup = settingsTab.add("group", undefined, undefined, {name: "settingsGroup"});
|
||||
settingsGroup.orientation = "column";
|
||||
settingsGroup.alignChildren = ["fill","top"];
|
||||
settingsGroup.spacing = 15;
|
||||
|
||||
var settingsLocationPanel = settingsGroup.add('panel', undefined, undefined);
|
||||
settingsLocationPanel.orientation = 'column'
|
||||
settingsLocationPanel.alignChildren = ['fill', 'fill'];
|
||||
settingsLocationPanel.margins = panelMargins;
|
||||
|
||||
var settingsLocationButton = settingsLocationPanel.add("button", undefined, undefined, {name: "settingsLocationButton"});
|
||||
settingsLocationButton.text = "Choose Default Location...";
|
||||
var settingsLocationText = settingsLocationPanel.add("statictext", undefined, undefined, {name: "settingsLocationText"});
|
||||
settingsLocationText.text = truncateFilePath(Folder.decode(DEFAULT_SETTINGS.settings.defaultOutputPath), separator);
|
||||
|
||||
var settingsQCPanel = settingsGroup.add('panel', undefined, undefined);
|
||||
settingsQCPanel.orientation = 'column'
|
||||
settingsQCPanel.alignChildren = ['fill', 'fill'];
|
||||
settingsQCPanel.margins = panelMargins;
|
||||
|
||||
var settingsQCCB = settingsQCPanel.add("checkbox", undefined, undefined);
|
||||
settingsQCCB.text = "Import Exports for QC";
|
||||
settingsQCCB.value = DEFAULT_SETTINGS.settings.qcExports;
|
||||
|
||||
var saveSettingsPanel = settingsGroup.add('panel', undefined, undefined);
|
||||
saveSettingsPanel.orientation = 'row';
|
||||
// saveSettingsPanel.alignment = ['fill', 'bottom'];
|
||||
saveSettingsPanel.alignChildren = ['fill', 'fill'];
|
||||
saveSettingsPanel.margins = panelMargins;
|
||||
var revealSettingsButton = saveSettingsPanel.add("button", undefined, undefined, {name: "saveSettingsButton"});
|
||||
revealSettingsButton.text = "Reveal Settings";
|
||||
var saveSettingsButton = saveSettingsPanel.add("button", undefined, undefined, {name: "saveSettingsButton"});
|
||||
saveSettingsButton.text = "Save Settings";
|
||||
|
||||
//<------ TEST ------->
|
||||
// Event handler used for spot bug testing to avoid going through entire render process
|
||||
/* testButton.addEventListener('mousedown', function(){
|
||||
var renderFolder = new Folder(renderFolderPath);
|
||||
var test = renderFolder;
|
||||
alert(test.toString())
|
||||
}) */
|
||||
|
||||
|
||||
addToRQ.onClick = function(){
|
||||
if(addToRQ.value == true){
|
||||
renderButton.text = 'Add Comps to RQ';
|
||||
} else {
|
||||
renderButton.text = 'Render'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
revealSettingsButton.addEventListener('mousedown', function(){
|
||||
var settingsFolder = getSettingsFolder();
|
||||
return settingsFolder.execute()
|
||||
})
|
||||
|
||||
settingsLocationButton.addEventListener('mousedown', function(){
|
||||
var updatedDefaultLocation = Folder.selectDialog('Select a default output location');
|
||||
var settingsLocation = updatedDefaultLocation.absoluteURI;
|
||||
var settingsDisplay = Folder.decode(settingsLocation);
|
||||
if(updatedDefaultLocation !== null){
|
||||
var truncatedDisplayText = truncateFilePath(settingsDisplay, separator);
|
||||
settingsLocationText.text = truncatedDisplayText;
|
||||
renderLocationText.text = truncatedDisplayText;
|
||||
DEFAULT_SETTINGS.settings.defaultOutputPath = updatedDefaultLocation.absoluteURI
|
||||
}
|
||||
return
|
||||
})
|
||||
|
||||
|
||||
/**
|
||||
* @description updates QC checkbox in UI
|
||||
*/
|
||||
settingsQCCB.onClick = function(){
|
||||
qcExports.value = settingsQCCB.value;
|
||||
DEFAULT_SETTINGS.settings.qcExports = settingsQCCB.value;
|
||||
}
|
||||
|
||||
/**
|
||||
* @description saves settings to settings file on disk
|
||||
*/
|
||||
|
||||
saveSettingsButton.addEventListener('mousedown', function(){
|
||||
saveSettingsButton.text = 'Saving...'
|
||||
if(writeSettingsFile(DEFAULT_SETTINGS)){
|
||||
alert('Settings saved.')
|
||||
}
|
||||
saveSettingsButton.text = "Save Settings"
|
||||
})
|
||||
|
||||
/**
|
||||
* @description opens default browser to reveal output module location on GDrive
|
||||
*/
|
||||
|
||||
omSourceButton.addEventListener('mousedown', function(){
|
||||
var userOS = OS;
|
||||
var launchCode = userOS.openUrl("https://drive.google.com/file/d/1c7ezAQF5_Sy-e0WlRHLGbPluproroBw1/view")
|
||||
})
|
||||
|
||||
|
||||
|
||||
helpEditText.text = setHelpMessage(scriptName, versionNumber);
|
||||
|
||||
|
||||
var topWalls = leftColumn.children;
|
||||
var bottomWalls = rightColumn.children;
|
||||
var wallsArray = [topWalls[0], topWalls[1], bottomWalls[0], bottomWalls[1]];
|
||||
|
||||
/**
|
||||
* @description selects or deselects all wall checkboxes
|
||||
*/
|
||||
allWalls.onClick = function(){
|
||||
|
||||
if(allWalls.value == false){
|
||||
allWalls.text = 'Select all walls'
|
||||
} else {
|
||||
allWalls.text = 'Deselect all walls'
|
||||
}
|
||||
for(var c = 0; c<wallsArray.length; c++){
|
||||
wallsArray[c].value = allWalls.value
|
||||
}
|
||||
}
|
||||
|
||||
var renderFolderPath = DEFAULT_SETTINGS.settings.defaultOutputPath;
|
||||
|
||||
|
||||
/**
|
||||
* @description sets location of parent output folder
|
||||
*/
|
||||
locationButton.addEventListener('mousedown', function(){
|
||||
var renderFolder = Folder.selectDialog('Select render destination');
|
||||
if(renderFolder !== null){
|
||||
renderFolderPath = renderFolder.fsName;
|
||||
var displayFolderPath = Folder.decode(renderFolderPath)
|
||||
var outputString = truncateFilePath(displayFolderPath, separator)
|
||||
renderLocationText.text = outputString
|
||||
}
|
||||
})
|
||||
|
||||
/**
|
||||
* @description begins render process and post-reender actions
|
||||
*/
|
||||
|
||||
renderButton.onClick = function(){
|
||||
try {
|
||||
app.beginUndoGroup("Renders Comps");
|
||||
var km = kmFunction;
|
||||
var proj = km.getProj();
|
||||
if(!proj) return
|
||||
var renderComps = [];
|
||||
|
||||
if(proj.selection.length < 1){
|
||||
var activeComp = proj.activeItem;
|
||||
if(activeComp instanceof CompItem){
|
||||
renderComps.push(activeComp);
|
||||
}
|
||||
|
||||
} else {
|
||||
var selection = proj.selection;
|
||||
for(var i = 0; i < selection.length; i++){
|
||||
if(selection[i] instanceof CompItem){
|
||||
renderComps.push(selection[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(renderComps.length < 1){
|
||||
alert("No valid comps found to render.");
|
||||
return;
|
||||
}
|
||||
|
||||
// NotchLC Output Modules
|
||||
var nlOMs = {
|
||||
base: [
|
||||
'AAC26a_A_NL',
|
||||
'AAC26a_B_NL',
|
||||
'AAC26a_C_NL',
|
||||
'AAC26a_D_NL'
|
||||
],
|
||||
alpha: [
|
||||
'AAC26a_A_NL-A',
|
||||
'AAC26a_B_NL-A',
|
||||
'AAC26a_C_NL-A',
|
||||
'AAC26a_D_NL-A'
|
||||
]
|
||||
}
|
||||
// ProRes Output Modules
|
||||
var prOMs = {
|
||||
base: [
|
||||
'AAC26a_A_PR',
|
||||
'AAC26a_B_PR',
|
||||
'AAC26a_C_PR',
|
||||
'AAC26a_D_PR',
|
||||
],
|
||||
alpha: [
|
||||
'AAC26a_A_PR-A',
|
||||
'AAC26a_B_PR-A',
|
||||
'AAC26a_C_PR-A',
|
||||
'AAC26a_D_PR-A',
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
var renderFolder = new Folder(renderFolderPath);
|
||||
if(!renderFolder.exists){
|
||||
renderFolder.create()
|
||||
}
|
||||
|
||||
if(renderFolder.fsName == '') {
|
||||
alert('Whoops!\rYou don\'t have a folder destination selcted. Select one and try again.');
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
var templateArray = [];
|
||||
var objKey = wallAlpha.value ? 'alpha' : 'base';
|
||||
var nlSelect = nlOMs[objKey];
|
||||
var prSelect = prOMs[objKey];
|
||||
|
||||
for(var t = 0; t<wallsArray.length; t++){
|
||||
var wall = wallsArray[t];
|
||||
if(wall.value){
|
||||
templateArray.push(nlSelect[[t]]);
|
||||
templateArray.push(prSelect[[t]])
|
||||
}
|
||||
}
|
||||
if(templateArray.length < 1){
|
||||
alert('Whoops!\rYou don\'t have any walls selected. Select atleast 1 wall to export and try again.');
|
||||
return
|
||||
}
|
||||
|
||||
var renderQueue = proj.renderQueue;
|
||||
if(renderQueue.numItems > 0){
|
||||
while(renderQueue.numItems > 0){
|
||||
renderQueue.item(renderQueue.numItems).remove()
|
||||
}
|
||||
}
|
||||
|
||||
var renderPipeline = buildRenderPipeline(renderComps,renderQueue,templateArray,renderFolder);
|
||||
// RENDERRRRR //
|
||||
app.endUndoGroup()
|
||||
|
||||
|
||||
if(proj.bitsPerChannel < 16){
|
||||
proj.bitsPerChannel = 16;
|
||||
}
|
||||
|
||||
if(addToRQ.value == false){
|
||||
renderQueue.render();
|
||||
}
|
||||
|
||||
|
||||
var completedComps = [];
|
||||
var completedNames = [];
|
||||
var failedComps = [];
|
||||
|
||||
for(var r = 0; r<renderPipeline.rqItems.length; r++){
|
||||
var item = renderPipeline.rqItems[r];
|
||||
if(item.status === RQItemStatus.DONE){
|
||||
completedComps.push(renderPipeline.rqComps[r]);
|
||||
} else {
|
||||
failedComps.push({
|
||||
comps : renderPipeline.rqComps[r],
|
||||
status: item.status
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
if(completedComps.length > 0){
|
||||
var baseOutputAlert = 'Success!\rYour files were exported to:\r\r' + Folder.decode(renderFolderPath) + '\r\r';
|
||||
if(qcExports.value){
|
||||
var aeFolders = createImportFolders('zz_QC', completedComps, km.getOrCreateFolder);
|
||||
alert(baseOutputAlert += 'Your exports will be imported into AE inside the folder named zz_QC for quality control.');
|
||||
importExportsIntoAE(proj, aeFolders, renderPipeline.outputFolders, renderPipeline.outputFileNames)
|
||||
} else {
|
||||
alert(baseOutputAlert)
|
||||
var outputFolder = new Folder(renderFolder.fsName);
|
||||
outputFolder.execute()
|
||||
}
|
||||
}
|
||||
|
||||
} catch(error) {
|
||||
alert("An error occured on line: " + error.line + "\nError message: " + error.message);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
// HELPER FUNCTIONS
|
||||
|
||||
/**
|
||||
* @description syncs QC exports settings
|
||||
* @param {any} newVal
|
||||
*/
|
||||
function syncQCExports(newVal){
|
||||
settingsQCCB.value = newVal;
|
||||
qcExports.value = newVal;
|
||||
DEFAULT_SETTINGS.settings.qcExports = newVal;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @description truncates input file path string for eventual display in UI
|
||||
* @param {string} filePathString
|
||||
* @param {string} separator - OS-specific path separator
|
||||
* @return {string} outputstring for display
|
||||
*/
|
||||
function truncateFilePath(filePathString, separator) {
|
||||
var pathArray = filePathString.split(separator);
|
||||
var startString = pathArray.slice(0, 1).join(separator);
|
||||
var endString = pathArray.slice(-2,pathArray.length).join(separator);
|
||||
|
||||
var outputString = '...' + separator + endString + separator;
|
||||
return outputString;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @description imports exported files back into AE and sorts into targeted folders
|
||||
* @param {object} proj - app project
|
||||
* @param {array} folders - array of comp folders
|
||||
* @param {string} locations - file path locations of exported files
|
||||
* @param {array} names - output file names
|
||||
*/
|
||||
function importExportsIntoAE(proj, folders, locations, names){
|
||||
var exports = getExports(locations, names);
|
||||
var compFolders = folders.compFolders;
|
||||
for(var e = 0; e<exports.length; e++){
|
||||
var renders = exports[e];
|
||||
var importedFootage = proj.importFile(new ImportOptions(File(renders)));
|
||||
for(var f = 0; f< compFolders.length; f++){
|
||||
var folder = compFolders[f];
|
||||
var importBaseName = importedFootage.name.replace(/.mov/g, '');
|
||||
var importBaseSplit = importBaseName.split('_');
|
||||
var importScreen = importBaseSplit.slice(-2,-1).toString();
|
||||
var importCodec = importBaseSplit.slice(-3,-2).toString();
|
||||
var pattern = new RegExp('_' + importCodec + '_' + importScreen + '_', 'g');
|
||||
var importAssetTest = importBaseName.replace(pattern,'_')
|
||||
if(importAssetTest === folder.name){
|
||||
importedFootage.parentFolder = folder;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
folders.parentFolder.selected = true
|
||||
|
||||
return
|
||||
}
|
||||
|
||||
/**
|
||||
* @description creates folders for imported renders to be sorted into
|
||||
* @param {string} parentFolderName
|
||||
* @param {array} exportedComps exported comps from AE
|
||||
* @param {Function} getFolders - callback function to search folders in AE
|
||||
* @return {Object} returns parent folder to import files into and comp folders that are created per rendered comp
|
||||
*/
|
||||
function createImportFolders(parentFolderName, exportedComps, getFolders){
|
||||
var parentFolder = getFolders(app.project,parentFolderName);
|
||||
var compFolders = [];
|
||||
for(var c = 0; c<exportedComps.length; c++){
|
||||
var exportedComp = exportedComps[c];
|
||||
var compFolder = getFolders(app.project, exportedComp.name);
|
||||
compFolder.parentFolder = parentFolder;
|
||||
compFolders.push(compFolder)
|
||||
}
|
||||
return {
|
||||
parentFolder: parentFolder,
|
||||
compFolders : compFolders
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @description gets exported files from output location
|
||||
* @param {array} locations - gets locations of output folders of each exported comp
|
||||
* @param {array} names - output filenames based on output modules
|
||||
* @return {array} absolute file paths of exports
|
||||
*/
|
||||
function getExports(locations, names){
|
||||
var exports = [];
|
||||
for(var l = 0; l< locations.length; l++){
|
||||
var location = locations[l];
|
||||
var outputFolder = new Folder(location);
|
||||
var files = outputFolder.getFiles('*.mov');
|
||||
for(var f = 0; f<files.length; f++){
|
||||
var file = files[f];
|
||||
for(var d = 0; d<names.length; d++){
|
||||
var dataName = names[d];
|
||||
if(file.name.replace(/%20/g, ' ') === dataName){
|
||||
exports.push(file.fsName)
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return exports
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @description builds render queue items, output modules, and output files
|
||||
* @param {array} comps - selected comps to be exported
|
||||
* @param {Object} rq - render queue object
|
||||
* @param {array} wallTemplates - output module templates
|
||||
* @param {Object} folderOutput - Selected parent output folder
|
||||
* @return {Object} render queue items, render queue comp references, output file names, output subfolders
|
||||
*/
|
||||
function buildRenderPipeline(comps,rq,wallTemplates,folderOutput){
|
||||
var outputFileNames = [];
|
||||
var rqComps = [];
|
||||
var rqItems = [];
|
||||
var outputFolders = [];
|
||||
for(var c = 0; c<comps.length; c++){
|
||||
var comp = comps[c];
|
||||
var rqComp = rq.items.add(comp);
|
||||
rqItems.push(rqComp)
|
||||
rqComps.push(rqComp.comp)
|
||||
var rqCompOMCollect = rqComp.outputModules;
|
||||
while(rqCompOMCollect.length < wallTemplates.length){
|
||||
rqCompOMCollect.add()
|
||||
}
|
||||
var folder_path = Folder.decode(folderOutput.fsName);
|
||||
for(var i = 0; i<rqCompOMCollect.length; i++){
|
||||
var om = rqComp.outputModule(i+1);
|
||||
var templateName = wallTemplates[i];
|
||||
var templateNameWall = templateName.split('_').slice(1,2);
|
||||
var templateNameContainer = templateName.split('_').slice(-1);
|
||||
|
||||
om.applyTemplate(templateName);
|
||||
|
||||
|
||||
var file_name = File.decode(om.file.name);
|
||||
var fileNameSplit = file_name.split('.');
|
||||
var fileNameString = fileNameSplit[0].split('_');
|
||||
var fileNameBaseWall = fileNameString.slice(0,fileNameString.length-1).join('_') + '_'+ templateNameContainer.toString() + '_' + templateNameWall.toString() + '_' + fileNameString.slice(-1).toString();
|
||||
var fileNameExtension = fileNameSplit.slice(-1);
|
||||
var outputFileName = fileNameBaseWall.toString() + '.' + fileNameExtension.toString();
|
||||
outputFileNames.push(outputFileName)
|
||||
var new_data = {
|
||||
"Output File Info": {
|
||||
"Base Path" : folder_path,
|
||||
"File Name" : outputFileName
|
||||
}
|
||||
}
|
||||
om.setSettings(new_data)
|
||||
}
|
||||
outputFolders.push(folder_path);
|
||||
}
|
||||
|
||||
return {
|
||||
rqItems : rqItems,
|
||||
rqComps : rqComps,
|
||||
outputFileNames: outputFileNames,
|
||||
outputFolders : outputFolders
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @description gets targeted OS-specific path separator
|
||||
* @return {string} separator
|
||||
*/
|
||||
function getSeparator(){
|
||||
var os = $.os.toLowerCase().indexOf('mac') >= 0 ? "MAC": "WINDOWS";
|
||||
var separator = os === 'MAC' ? '/' : '\\';
|
||||
return separator
|
||||
}
|
||||
|
||||
/**
|
||||
* @description gets settings folder where settings json lives
|
||||
* @return {Folder} OS-targeted settings folder
|
||||
*/
|
||||
function getSettingsFolder(){
|
||||
var separator = getSeparator();
|
||||
var userDataFolder = new Folder(Folder.userData.absoluteURI);
|
||||
var kmToolsFolder = new Folder(userDataFolder.absoluteURI + '/km-tools');
|
||||
if(!kmToolsFolder.exists){
|
||||
kmToolsFolder.create()
|
||||
}
|
||||
|
||||
var settingsFolder = new Folder(kmToolsFolder.absoluteURI + '/sparks-render-helper');
|
||||
if(!settingsFolder.exists){
|
||||
settingsFolder.create()
|
||||
}
|
||||
|
||||
return settingsFolder
|
||||
}
|
||||
|
||||
/**
|
||||
* @description gets settings file
|
||||
* @return {File} settings json file
|
||||
*/
|
||||
function getSettingsFile(){
|
||||
var settingsFile = new File(getSettingsFolder().absoluteURI + '/settings.json')
|
||||
return settingsFile
|
||||
}
|
||||
|
||||
/**
|
||||
* @description reads settings json file
|
||||
* @return {Object} json data from settings file
|
||||
*/
|
||||
function readSettingsFile(){
|
||||
var file = getSettingsFile();
|
||||
if(!file.exists){
|
||||
return {
|
||||
'settings': {}
|
||||
}
|
||||
}
|
||||
|
||||
file.open('r');
|
||||
var data = file.read();
|
||||
file.close();
|
||||
|
||||
try{
|
||||
return JSON.parse(data)
|
||||
} catch (e) {
|
||||
return {
|
||||
settings: []
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @description writes data to settings file
|
||||
* @param {Object} data - data to be written to json file
|
||||
* @return {boolean}
|
||||
*/
|
||||
function writeSettingsFile(data){
|
||||
var file = getSettingsFile();
|
||||
|
||||
var json = JSON.stringify(data, null, 4);
|
||||
|
||||
if(!file.open('w')){
|
||||
alert('Could not open settings file:\n' + file.absoluteURI)
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
// file.open('w');
|
||||
file.write(json);
|
||||
file.close()
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @description builds help message for help tab
|
||||
* @param {string} scriptName
|
||||
* @param {srting} versionNumber
|
||||
* @return {string}
|
||||
*/
|
||||
function setHelpMessage(scriptName, versionNumber){
|
||||
var lines = [
|
||||
'ABOUT ' + scriptName.toUpperCase(),
|
||||
'',
|
||||
scriptName + ' automates the rendering process for all outputs that make up the pixel map for Amazon Accelerate 2026.',
|
||||
'',
|
||||
'------------------------',
|
||||
'HOW TO USE ' + scriptName.toUpperCase() + ':',
|
||||
'',
|
||||
'STEP 01: Import Output Modules from GDrive',
|
||||
'Import the most up-to-date preset output modules into your Render Queue. The output modules are stored on the team\'s GDrive in the form of a \'.aom\' file. This step is essential as the script\'s success is based on the output module names.',
|
||||
'',
|
||||
'-----------',
|
||||
'STEP 02: SELECT YOUR RENDER COMP',
|
||||
'Select or open the comp that will be rendered into the various wall deliverables.',
|
||||
'',
|
||||
'-----------',
|
||||
'STEP 03: SELECT WALLS, ALPHA ON/OFF, AND OUTPUT LOCATION',
|
||||
'Select the walls you\'d like to render. There is a checkbox to select all walls or deselect all walls. Select an option for with alpha channel or no alpha channel. Additionally, you can toggle \'QC Exports in AE\' to reimport your renders for QC in AE. Finally, select your desired render output location.',
|
||||
'',
|
||||
'-----------',
|
||||
'STEP 04: RENDER',
|
||||
'Once all of your walls, details, and output location are set, then click Render and your selected comp will be placed in the render queue with the correlating wall selection output modules. The chosen output location will also be updated in the render queue. Rendering will also begin at this time. Once rendering is complete, you will be notified with a success prompt and the location of your renders. Upon exiting the prompt, your render location folder window on your desktop will be revealed.',
|
||||
'',
|
||||
'-----------',
|
||||
'GOOD TO KNOW',
|
||||
'- This script assumes you have named your files correctly according to the media guide provided by Sparks. There will be a correlating wall identifier (A, B, C, or D) added to the end of your file name before the extension.',
|
||||
'- In the Settings tab, you may update your default output location for your renders. By default, the render location directs to \'[projectFolder]/renders/[output files].\'',
|
||||
'- Upon updating any settings in the Settings tab, be sure to click \'Save Settings\' to ensure your settings are updated.',
|
||||
'-----------',
|
||||
'Script: ' + scriptName.toUpperCase(),
|
||||
'Version: ' + versionNumber,
|
||||
'Contact: Kyle Harter kylenmotion@gmail.com'
|
||||
];
|
||||
|
||||
return lines.join('\r');
|
||||
}
|
||||
|
||||
win.onResizing = win.onResize = function (){
|
||||
this.layout.resize();
|
||||
};
|
||||
|
||||
if(win instanceof Window){
|
||||
win.center();
|
||||
win.show();
|
||||
} else {
|
||||
win.layout.layout(true);
|
||||
win.layout.resize();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}(this))
|
||||
@@ -1,45 +0,0 @@
|
||||
/**
|
||||
* @description a headless script to do something cool in AE
|
||||
* @name km-scriptname
|
||||
* @author Kyle Harter <kylenmotion@gmail.com>
|
||||
* @version 1.0.0
|
||||
*
|
||||
* @license This script is provided "as is," without warranty of any kind, expressed or implied. In
|
||||
* no event shall the author be held liable for any damages arising in any way from the use of this
|
||||
* script.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
(function () {
|
||||
//@include "./library/km_helperFunctions.jsx";
|
||||
//@include "./library/km_scriptUI_functions.jsx";
|
||||
//@include "./library/km_utilityFunctions.jsx";
|
||||
//@include "./library/km_textAnimators.jsx";
|
||||
//@include "./library/km_systemFunctions.jsx";
|
||||
try {
|
||||
app.beginUndoGroup("what does this script do?");
|
||||
var km = kmFunction;
|
||||
var kmScript = kmScriptUI;
|
||||
var kmUtils = kmUtilityFunctions;
|
||||
var kmTextAnims = KMTextAnimatorsLib;
|
||||
var kmSystems = kmSystemsLib;
|
||||
} catch (error) {
|
||||
alert(
|
||||
"An error occured on line: " +
|
||||
error.line +
|
||||
"\nError message: " +
|
||||
error.message,
|
||||
);
|
||||
} finally {
|
||||
// this always runs no matter what
|
||||
app.endUndoGroup();
|
||||
}
|
||||
|
||||
function runScript() {
|
||||
alert("Script is run");
|
||||
return;
|
||||
}
|
||||
})();
|
||||
@@ -1,94 +0,0 @@
|
||||
/**
|
||||
* @description a script wiyh a UI that will do something really cool in AE
|
||||
* @name km-scriptname
|
||||
* @author Kyle Harter <kylenmotion@gmail.com>
|
||||
* @version 1.0.0
|
||||
*
|
||||
* @license This script is provided "as is," without warranty of any kind, expressed or implied. In
|
||||
* no event shall the author be held liable for any damages arising in any way from the use of this
|
||||
* script.
|
||||
*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
(function(thisObj){
|
||||
|
||||
//@include ".../library/km_helperFunctions.jsx";
|
||||
//@include ".../library/km_scriptUI_functions.jsx";
|
||||
//@include ".../library/km_utilityFunctions.jsx";
|
||||
//@include ".../library/km_textAnimators.jsx";
|
||||
//@include ".../library/km_systemFunctions.jsx";
|
||||
|
||||
var scriptName = "Script Name";
|
||||
|
||||
createUI(thisObj)
|
||||
|
||||
function createUI(thisObj){
|
||||
var win = thisObj instanceof Panel
|
||||
? thisObj
|
||||
: new Window("window", scriptName, undefined, {
|
||||
resizeable: true
|
||||
})
|
||||
|
||||
win.orientation = 'column';
|
||||
win.alignChildren = ["left", "top"];
|
||||
|
||||
var mainGroup = win.add("group", undefined, "Main Group");
|
||||
mainGroup.orientation = 'column';
|
||||
|
||||
|
||||
var applyGroup = mainGroup.add("group", undefined, "Apply Group");
|
||||
applyGroup.orientation = 'row';
|
||||
var applyButton = applyGroup.add("button", undefined, "Apply");
|
||||
applyButton.preferredSize = [-1,30];
|
||||
applyButton.helpTip = "Click: Apply markers to selected layers.\rShift+Click: Apply markers to beginning of a comp."
|
||||
|
||||
|
||||
applyButton.onClick = function(){
|
||||
try {
|
||||
app.beginUndoGroup("What script does");
|
||||
|
||||
var km = kmFunction;
|
||||
var kmScript = kmScriptUI;
|
||||
var kmUtils = kmUtilityFunctions;
|
||||
var kmTextAnims = KMTextAnimatorsLib;
|
||||
|
||||
runScript()
|
||||
|
||||
} catch(error) {
|
||||
alert("An error occured on line: " + error.line + "\nError message: " + error.message);
|
||||
} finally {
|
||||
// this always runs no matter what
|
||||
app.endUndoGroup()
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function runScript(){
|
||||
alert("Script is run")
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
win.onResizing = win.onResize = function (){
|
||||
this.layout.resize();
|
||||
};
|
||||
|
||||
if(win instanceof Window){
|
||||
win.center();
|
||||
win.show();
|
||||
} else {
|
||||
win.layout.layout(true);
|
||||
win.layout.resize();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
}(this))
|
||||
Vendored
-2731
File diff suppressed because it is too large
Load Diff
-91
@@ -1,91 +0,0 @@
|
||||
/// <reference path="JavaScript.d.ts" />
|
||||
|
||||
interface ExternalObjectConstructor {
|
||||
readonly prototype: ExternalObject
|
||||
|
||||
/**
|
||||
* Creates a new ExternalObject object.
|
||||
*/
|
||||
new (lib: string): ExternalObject
|
||||
(lib: string): ExternalObject
|
||||
}
|
||||
declare const ExternalObject: ExternalObjectConstructor
|
||||
|
||||
interface ExternalObject {
|
||||
/**
|
||||
* Set to true to write status information to standard output (the
|
||||
* JavaScript Console in the ExtendScript Toolkit). Set to false to turn
|
||||
* logging off. Default is false.
|
||||
*/
|
||||
log: boolean
|
||||
|
||||
/**
|
||||
* A set of alternate paths in which to search for the shared library files, a
|
||||
* single string with multiple path specifications delimited by semicolons
|
||||
* (;). Paths can be absolute or relative to the Folder.startup location.
|
||||
*/
|
||||
searchFolders: string
|
||||
|
||||
/**
|
||||
* The version of the library, as returned by ESGetVersion()
|
||||
*/
|
||||
version: number
|
||||
|
||||
/**
|
||||
* Reports whether a compiled C/C++ library can be found, but does not load it. If logging is on, the
|
||||
* paths searched are reported to the JavaScript Console in the ExtendScript Toolkit.
|
||||
* Returns true if the library is found, false otherwise.
|
||||
* @param spec The file specification for the compiled library, with or without path information.
|
||||
*/
|
||||
search(spec: string): boolean
|
||||
|
||||
/**
|
||||
* Explicitly shuts down the ExternalObject dynamic library wrapped by this instance.
|
||||
* It can be helpful to force a shutdown of the external library if termination of external libraries during
|
||||
* the shutdown of the hosting application does not occur in the correct order.
|
||||
*/
|
||||
terminate(): undefined
|
||||
}
|
||||
|
||||
interface CSXSEventConstructor {
|
||||
readonly prototype: CSXSEvent
|
||||
|
||||
/**
|
||||
* Creates a new CSXSEvent object.
|
||||
*/
|
||||
new (type?: string, scope?: string, data?: string): CSXSEvent
|
||||
(type?: string, scope?: string, data?: string): CSXSEvent
|
||||
}
|
||||
declare const CSXSEvent: CSXSEventConstructor
|
||||
|
||||
interface CSXSEvent {
|
||||
/**
|
||||
* Retrieves the unique identifier of the application from which this event was dispatched.
|
||||
*/
|
||||
readonly appId: string
|
||||
|
||||
/**
|
||||
* Retrieves or sets the payload of this event.
|
||||
*/
|
||||
data: string
|
||||
|
||||
/**
|
||||
* Retrieves the unique identifier of the extension from which this event was dispatched.
|
||||
*/
|
||||
readonly extensionId: string
|
||||
|
||||
/**
|
||||
* Retrieves the scope of this event.
|
||||
*/
|
||||
scope: string
|
||||
|
||||
/**
|
||||
* Retrieves the type of this event.
|
||||
*/
|
||||
type: string
|
||||
|
||||
/**
|
||||
* Dispatch the event
|
||||
*/
|
||||
dispatch(): void
|
||||
}
|
||||
Vendored
-3007
File diff suppressed because it is too large
Load Diff
Vendored
-72
@@ -1,72 +0,0 @@
|
||||
/// <reference path="./PlugPlugExternalObject.d.ts" />
|
||||
|
||||
// A commonly used construct for loading XMPScript into
|
||||
// ExtendScript contexts.
|
||||
interface ExternalObjectConstructor {
|
||||
AdobeXMPScript: ExternalObject | undefined
|
||||
}
|
||||
|
||||
interface XMPMetaConstructor {
|
||||
/** Creates an empty object. */
|
||||
new (): XMPMetaInstance
|
||||
/**
|
||||
* @param packet A String containing an XML file or an XMP packet.
|
||||
*/
|
||||
new (packet: string): XMPMetaInstance
|
||||
/**
|
||||
* @param buffer The UTF-8 or UTF-16 encoded bytes of an XML file
|
||||
* or an XMP packet. This array is the result of a call to `serializeToArray`
|
||||
* on an `XMPMeta` instance.
|
||||
*/
|
||||
new (buffer: number[]): XMPMetaInstance
|
||||
/**
|
||||
* @param prefix The prefix of the namespace.
|
||||
* @example XMPMeta.getNamespacePrefix('xmp'); // 'http://ns.adobe.com/xap/1.0/'
|
||||
*/
|
||||
getNamespaceURI(prefix: string): string
|
||||
/**
|
||||
* @param uri The URI of the namespace.
|
||||
* @example XMPMeta.getNamespacePrefix('http://ns.adobe.com/xap/1.0/'); // 'xmp:'
|
||||
*/
|
||||
getNamespacePrefix(uri: string): string
|
||||
}
|
||||
type XMPProperty = {
|
||||
locale: string
|
||||
namespace: string
|
||||
options: string
|
||||
path: string
|
||||
value: string
|
||||
}
|
||||
interface XMPMetaInstance {
|
||||
doesPropertyExist(namespace: string, value: string): boolean
|
||||
getProperty(namespace: string, property: string): XMPProperty
|
||||
setProperty(namespace: string, property: string, value: string): boolean
|
||||
countArrayItems(namespace: string, property: string): number
|
||||
getArrayItem(namespace: string, property: string, itemIndex: number): XMPProperty
|
||||
deleteProperty(namespace: string, property: string): boolean
|
||||
appendArrayItem(
|
||||
namespace: string,
|
||||
property: string,
|
||||
arrayOptions: string,
|
||||
valueToAppend: string,
|
||||
valueOptions: string,
|
||||
): boolean
|
||||
dumpObject(): string
|
||||
serialize(): string
|
||||
getNamespaceURI(ns: string): string
|
||||
}
|
||||
|
||||
declare const XMPMeta: XMPMetaConstructor | undefined
|
||||
|
||||
interface XMPConstConstructor {
|
||||
new (): XMPConstInstance
|
||||
NS_DM: string
|
||||
NS_DC: string
|
||||
ARRAY_IS_ORDERED: string
|
||||
}
|
||||
|
||||
interface XMPConstInstance {
|
||||
// Instance stuff.
|
||||
}
|
||||
|
||||
declare const XMPConst: XMPConstConstructor | undefined
|
||||
Vendored
-152
@@ -1,152 +0,0 @@
|
||||
/// <reference path="JavaScript.d.ts" />
|
||||
/// <reference path="XMPScript.d.ts" />
|
||||
|
||||
/**
|
||||
* The global BridgeTalk object.
|
||||
*/
|
||||
declare var BridgeTalk: any
|
||||
|
||||
/**
|
||||
* The Infinity global property is a predefined variable with the value for infinity.
|
||||
*/
|
||||
declare var Infinity: number
|
||||
|
||||
/**
|
||||
* The NaN global property is a predefined variable with the value NaN (Not-a-Number), as specified by the IEEE-754 standard.
|
||||
*/
|
||||
declare var NaN: number
|
||||
|
||||
/**
|
||||
* The application object
|
||||
*/
|
||||
declare var app: Application
|
||||
declare interface Application {}
|
||||
|
||||
/**
|
||||
* Displays an alert box
|
||||
* @param message The text to display
|
||||
* @param title The title of the alert; ignored on the Macintosh
|
||||
* @param errorIcon Display an Error icon; ignored on the Macintosh
|
||||
*/
|
||||
declare function alert(message: string, title?: string, errorIcon?: boolean): void
|
||||
|
||||
/**
|
||||
* Displays an alert box with Yes and No buttons; returns true for Yes
|
||||
* @param message The text to display
|
||||
* @param noAsDefault Set to true to set the No button as the default button
|
||||
* @param title The title of the alert; ignored on the Macintosh
|
||||
*/
|
||||
declare function confirm(message: string, noAsDefault?: boolean, title?: string): boolean
|
||||
|
||||
/**
|
||||
* Decodes a string created with encodeURI().
|
||||
* @param uri The text to decode.
|
||||
*/
|
||||
declare function decodeURI(uri: string): string
|
||||
|
||||
/**
|
||||
* Decodes a string created with encodeURIComponent().
|
||||
* @param uri The text to decode.
|
||||
*/
|
||||
declare function decodeURIComponent(uri: string): string
|
||||
|
||||
/**
|
||||
* Encodes a string after RFC2396.
|
||||
* Create an UTF-8 ASCII encoded version of this string. The string is converted into UTF-8. Every non-alphanumeric character is encoded as a percent escape
|
||||
* character of the form %xx, where xx is the hex value of the character. After the conversion to UTF-8 encoding and escaping, it is guaranteed that the string does not contain characters codes greater than 127. The list of characters not to be encoded is -_.!~*'();/?:@&=+$,#. The method returns false on errors.
|
||||
* @param text The text to encode.
|
||||
*/
|
||||
declare function encodeURI(text: string): string
|
||||
|
||||
/**
|
||||
* Encodes a string after RFC2396.
|
||||
* Create an UTF-8 ASCII encoded version of this string. The string is converted into UTF-8. Every non-alphanumeric character is encoded as a percent escape
|
||||
* character of the form %xx, where xx is the hex value of the character. After the conversion to UTF-8 encoding and escaping, it is guaranteed that the string does not contain characters codes greater than 127. The list of characters not to be encoded is -_.!~*'(). The method returns false on errors.
|
||||
* @param text The text to encode.
|
||||
*/
|
||||
declare function encodeURIComponent(text: string): string
|
||||
|
||||
/**
|
||||
* Creates a URL-encoded string from aString.
|
||||
* In the new string, characters of aString that require URL encoding are replaced with the format %xx, where xx is the hexadecimal value of the character code in the Unicode character set.This format is used to transmit information appended to a URL during, for example, execution of the GET method.Use the unescape() global function to translate the string back into its original format. Returns a string which is aString URL-encoded.
|
||||
* @param aString The string to be encoded.
|
||||
*/
|
||||
declare function escape(aString: string): string
|
||||
|
||||
/**
|
||||
* Evaluates its argument as a JavaScript script, and returns the result of evaluation.
|
||||
* You can pass the result of an object's toSource() method to reconstruct that object.
|
||||
* @param stringExpression The string to evaluate.
|
||||
*/
|
||||
declare function eval(stringExpression: string): any
|
||||
|
||||
/**
|
||||
* Evaluates an expression and reports whether the result is a finite number.
|
||||
* Returns true if the expression is a finite number, false otherwise. False if the value is infinity or negative infinity.
|
||||
* @param expression Any valid JavaScript expression.
|
||||
*/
|
||||
declare function isFinite(expression: number): boolean
|
||||
|
||||
/**
|
||||
* Evaluates an expression and reports whether the result is "Not-a-Number" (NaN).
|
||||
* Returns true if the result of evaluation is not a number (NaN), false if the value is a number.
|
||||
* @param expression Any valid JavaScript expression.
|
||||
*/
|
||||
declare function isNaN(expression: number): boolean
|
||||
|
||||
/**
|
||||
* Returns true if the supplied string is a valid XML name.
|
||||
* @param name The XML name to test.
|
||||
*/
|
||||
declare function isXMLName(name: string): boolean
|
||||
|
||||
/**
|
||||
* Localizes a ZString-encoded string and merges additional arguments into the string.
|
||||
* @param what The string to localize. A ZString-encoded string that can contain placeholder for additional arguments in the form %1 to %n.
|
||||
* @param arguments Optional argument(s) to be merged into the string. There may be more than one argument.
|
||||
*/
|
||||
declare function localize(what: string, ...arguments: any[]): string
|
||||
|
||||
/**
|
||||
* Extracts a floating-point number from a string.
|
||||
* Parses a string to find the first set of characters that can be converted to a floating point number, and returns that number, or NaN if it does not encounter characters that it can converted to a number.The function supports exponential notation.
|
||||
* @param text The string from which to extract a floating point number.
|
||||
*/
|
||||
declare function parseFloat(text: string): number
|
||||
|
||||
/**
|
||||
* Extracts an integer from a string.
|
||||
* Parses a string to find the first set of characters, in a specified base, that can be converted to an integer, and returns that integer, or NaN if it does not encounter characters that it can convert to a number.
|
||||
* @param text The string from which to extract an integer.
|
||||
* @param base The base of the string to parse (from base 2 to base 36). If not supplied, base is determined by the format of string.
|
||||
*/
|
||||
declare function parseInt(text: string, base?: number): number
|
||||
|
||||
/**
|
||||
* Displays a dialog allowing the user to enter text
|
||||
* Returns null if the user cancelled the dialog, the text otherwise
|
||||
* @param prompt The text to display
|
||||
* @param default_ The default text to preset the edit field with
|
||||
* @param title The title of the dialog;
|
||||
*/
|
||||
declare function prompt(prompt: string, default_?: string, title?: string): string | null
|
||||
|
||||
/**
|
||||
* Defines the default XML namespace.
|
||||
* This is a replacement function for the standard JavaScript statement set default xml namespace.
|
||||
* @param namespace The namespace to use. Omit this parameter to return to the empty namespace. This is either a Namespace object or a string.
|
||||
*/
|
||||
declare function setDefaultXMLNamespace(namespace: Namespace): void
|
||||
|
||||
/**
|
||||
* Translates URL-encoded string into a regular string, and returns that string.
|
||||
* Use the escape() global function to URL-encode strings.
|
||||
* @param stringExpression The URL-encoded string to convert.
|
||||
*/
|
||||
declare function unescape(stringExpression: string): string
|
||||
|
||||
/**
|
||||
* Creates a source code representation of the supplied argument, and returns it as a string.
|
||||
* @param what The object to uneval.
|
||||
*/
|
||||
declare function uneval(what: any): string
|
||||
Vendored
-2933
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user