removed old scripts

This commit is contained in:
Kyle Harter
2026-08-10 17:46:35 -04:00
parent a76c43c97e
commit a9f1758ebb
6 changed files with 0 additions and 556 deletions
@@ -1,71 +0,0 @@
/**
* @description a headless script that will set the comp to the selected layer's current duration
* @name km-comp-duration-from-layer
* @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("Layer to comp dur");
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;
setCompDurationFromLayer(activeComp,selLayers[0])
} catch (error) {
alert(
"An error occured on line: " +
error.line +
"\nError message: " +
error.message,
);
} finally {
// this always runs no matter what
app.endUndoGroup();
}
function setCompDurationFromLayer(comp,layer){
var layerStart = layer.startTime;
var layerIn = layer.inPoint;
var layerOut = layer.outPoint;
var layerShiftTime;
comp.duration = layerOut-layerIn;
for(var i = 1; i<=comp.numLayers; i++){
var compLayer = comp.layer(i);
$.writeln("Layer Start Time: " + layerIn)
if(layerIn > 0){
layerShiftTime = -layerIn;
$.writeln("Layer Shift Time: " + layerShiftTime)
} else {
layerShiftTime = layerIn;
}
compLayer.startTime += layerShiftTime
}
return comp
}
})();
-134
View File
@@ -1,134 +0,0 @@
/**
* @description a script wiyh a UI that will do something really cool in AE
* @name km-layer-labeler
* @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";
var scriptName = "km-layer-labeler";
createUI(thisObj)
function createUI(thisObj){
var kmUtils = kmUtilityFunctions;
var file = new File('/Users/Shared/km/km-layer-labels.json');
var config = kmUtils.readJSONFile(file);
var btnSize = [100,25]
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';
if(config && config.labels && config.labels.length > 0){
var buttonsPerRow = 4;
var labelGroup = mainGroup.add("group", undefined, "Labels Group");
labelGroup.orientation = "column";
labelGroup.alignChildren = ["left", "top"];
for(var i = 0; i<config.labels.length; i++){
if(i % buttonsPerRow === 0){
var rowGroup = labelGroup.add("group", undefined);
rowGroup.orientation = "row";
rowGroup.spacing = 5;
}
(function(labelObj){
var btn = rowGroup.add("button", undefined, labelObj.label);
btn.preferredSize = btnSize;
btn.onClick = function (){
app.beginUndoGroup("Label Comps");
var kmFunc = kmFunction;
var proj = kmFunc.getProj();
var activeComp = kmFunc.getActiveComp(proj);
var selectedLayers = kmFunc.getSelectedLayers(activeComp);
if(selectedLayers){
var allPrefixes = [];
for(var t = 0; t<config.labels.length; t++){
allPrefixes.push(config.labels[t].prefix + "-");
}
}
var shift = ScriptUI.environment.keyboardState.shiftKey;
var currentPrefix = '';
if(shift){
currentPrefix = labelObj.prefix + "-";
} else {
currentPrefix = labelObj.prefix;
}
for(var j=0; j<selectedLayers.length; j++){
var layer = selectedLayers[j];
var originalName = layer.name;
if(originalName.indexOf(currentPrefix) === 0){
continue
}
for(var n = 0; n<allPrefixes.length; n++){
if(originalName.indexOf(allPrefixes[n]) === 0){
originalName = originalName.substring(allPrefixes[n].length);
break;
}
}
layer.name = currentPrefix;
}
app.endUndoGroup();
}
})(config.labels[i])
}
}
var helpButton = mainGroup.add("button", undefined, "Help");
helpButton.alignment = ["fill", "top"];
helpButton.preferredSize = [-1,btnSize[1]];
helpButton.addEventListener('mousedown',function(){
kmScriptUI.showHelp()
})
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,66 +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(km.getProj());
var selLayers = km.getSelectedLayers(activeComp);
nullNamefromFirstChild(selLayers)
} catch (error) {
alert(
"An error occured on line: " +
error.line +
"\nError message: " +
error.message,
);
} finally {
// this always runs no matter what
app.endUndoGroup();
}
function nullNamefromFirstChild(layers) {
var found = false
for(var i = 0; i<layers.length; i++){
var layer = layers[i];
if(layer.parent !== null){
found = true;
var parentLayer = layer.parent;
parentLayer.name = layer.name + '-NULL'
}
}
if(!found){
alert("Whoops!\r\r You don't have any layers with parents selected. Select a layer with a parent and try again.")
return
}
return;
}
})();
-159
View File
@@ -1,159 +0,0 @@
/**
* @description a script wiyh a UI that will do something really cool in AE
* @name km-layer-props-copy-paste
* @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 = "km-layer-props-copy-paste";
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 copyPasteGroup = mainGroup.add("group", undefined, "Copy Paste Group");
copyPasteGroup.orientation = 'row';
var copyButton = copyPasteGroup.add("button", undefined, "Copy");
copyButton.preferredSize = [-1,30];
var pasteButton = copyPasteGroup.add("button", undefined, "Paste");
pasteButton.preferredSize = [-1,30];
var layerInfoGroup = mainGroup.add('group', undefined, 'Copy Info');
layerInfoGroup.alignChildren = ['left','top'];
var layerInfoText = layerInfoGroup.add('staticText', undefined, 'text');
layerInfoText.characters = 50;
var layerPropData = [{
label: null,
name: '',
comment: ''
}];
copyButton.onClick = function(){
try {
app.beginUndoGroup("What script does");
var km = kmFunction;
var kmScript = kmScriptUI;
var kmUtils = kmUtilityFunctions;
var kmTextAnims = KMTextAnimatorsLib;
var activeComp = km.getActiveComp(km.getProj());
var selLayers = km.getSelectedLayers(activeComp);
copyProps(selLayers)
layerInfoText.text = layerPropData.length + ' layers copied from ' + activeComp.name;
} catch(error) {
alert("An error occured on line: " + error.line + "\nError message: " + error.message);
} finally {
// this always runs no matter what
app.endUndoGroup()
}
}
pasteButton.onClick = function(){
try {
app.beginUndoGroup("What script does");
var km = kmFunction;
var kmScript = kmScriptUI;
var kmUtils = kmUtilityFunctions;
var kmTextAnims = KMTextAnimatorsLib;
var activeComp = km.getActiveComp(km.getProj());
var selLayers = km.getSelectedLayers(activeComp);
pasteProps(selLayers)
layerInfoText.text = layerPropData.length + ' layers pasted to ' + activeComp.name;
} catch(error) {
alert("An error occured on line: " + error.line + "\nError message: " + error.message);
} finally {
// this always runs no matter what
app.endUndoGroup()
}
}
function copyProps(selLayers){
layerPropData = [];
for(var i = 0; i<selLayers.length; i++){
var selLayer = selLayers[i];
layerPropData.push({
label: selLayer.label,
name: selLayer.name,
comment: selLayer.comment
})
}
return
}
function pasteProps(selLayers){
for(var i = 0; i<selLayers.length; i++){
var selLayer = selLayers[i];
selLayer.label = layerPropData[i].label
selLayer.name = layerPropData[i].name
selLayer.comment = layerPropData[i].comment
}
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))
@@ -1,66 +0,0 @@
/**
* @description a headless script to do something cool in AE
* @name km-recurse-cti-comp-center
* @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("Moves each comp CTI to middle of comp timeline for easy viewing when viewing comp");
var km = kmFunction;
var kmScript = kmScriptUI;
var kmUtils = kmUtilityFunctions;
var kmTextAnims = KMTextAnimatorsLib;
var kmSystems = kmSystemsLib;
var proj = km.getProj();
batchCTICompCenter(proj)
} catch (error) {
alert(
"An error occured on line: " +
error.line +
"\nError message: " +
error.message,
);
} finally {
// this always runs no matter what
app.endUndoGroup();
}
function batchCTICompCenter(proj) {
var compsArray = []
km.traverseFolder(proj, function (item){
if(item instanceof CompItem){
item.time = item.duration/2;
compsArray.push({
compItem: item,
compName: item.name
})
}
})
var msg = 'Analysis is complete!\r\r' + compsArray.length + ' comps\' CTIs were placed in the middle of their timelines.';
alert(msg)
return;
}
})();
@@ -1,60 +0,0 @@
/**
* @description a headless script to do something cool in AE
* @name km-trim-selected-comps-work_area
* @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 comps = km.getSelectedComps(km.getProj()).comps;
var trimmedComps = trimCompsWorkArea(comps);
alert('Comps Trimmed: ' + trimmedComps)
} catch (error) {
alert(
"An error occured on line: " +
error.line +
"\nError message: " +
error.message,
);
} finally {
// this always runs no matter what
app.endUndoGroup();
}
function trimCompsWorkArea(comps) {
var compsTrimmed = 0
for(var i = 0; i < comps.length; i++){
var comp = comps[i];
comp.openInViewer();
app.executeCommand(2360);
comp.time = comp.duration/2;
compsTrimmed++
}
return compsTrimmed
}
})();