This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function setAeMetadata(propName, propValue) { | |
if (ExternalObject.AdobeXMPScript === undefined) { | |
ExternalObject.AdobeXMPScript = new ExternalObject("lib:AdobeXMPScript"); | |
} | |
if (!app.project || !ExternalObject.AdobeXMPScript || !XMPMeta) return; | |
var prefix = "xmp:"; | |
var uri = XMPMeta.getNamespaceURI(prefix); | |
var newPropName = prefix + propName; | |
var metadata = new XMPMeta(app.project.xmpPacket); | |
metadata.setProperty(uri, newPropName, propValue.toString()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function rename(word) { | |
var array = app.project.activeItem.selectedLayers; | |
for (var i = 0; i < array.length; i++) { | |
var layer = array[i]; | |
if(word[i]){ | |
layer.name = word[i]; | |
} | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// JS / CEP Extension | |
const csInterface = new CSInterface(); | |
csInterface.addEventListener('myEvent', (evt) => { | |
// do stuff | |
}); | |
// ExtendScript | |
var xLib = new ExternalObject("lib:\PlugPlugExternalObject"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
L = thisLayer; | |
s = transform.scale.value; | |
while (L.hasParent){ | |
L = L.parent; | |
for (i = 0; i < s.length; i++) s[i] *= 100/L.transform.scale.value[i] | |
} | |
s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Example on how to execute an ExtendScript script inside of an After Effects C++ Plugin | |
AEGP_SuiteHandler suites(in_data->pica_basicP); | |
A_Boolean outAvailablePB; | |
AEGP_MemHandle outResultPH; | |
AEGP_MemHandle outErrorStringPH; | |
ERR(suites.UtilitySuite4()->AEGP_IsScriptingAvailable(&outAvailablePB)); | |
ERR(suites.UtilitySuite4()->AEGP_ExecuteScript(NULL, "alert(123);", true, &outResultPH, &outErrorStringPH)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Reveal in Composition for the first item selected in the project panel | |
var item = app.project.selection[0]; | |
if(item){ | |
var comp = item.usedIn[0]; | |
if(comp){ | |
comp.openInViewer(); | |
for (var i = 0; i < comp.layers.length; i++) { | |
var layer = comp.layers[i+1]; | |
layer.selected = layer instanceof AVLayer && layer.source.id === item.id; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Loop through all keyframes of selected properties and delete duplicates that don't impact animation | |
if(!app.project.activeItem instanceof CompItem){ | |
alert('Please Select a Comp'); | |
} | |
else if(!app.project.activeItem.selectedProperties[0]){ | |
alert('Please Select at least one Property with Keyframes'); | |
}else{ | |
var comp = app.project.activeItem; | |
var keyedProps = app.project.activeItem.selectedProperties; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const startIndex = thisLayer.index + 1; | |
const endIndex = thisComp.numLayers; | |
let activeLayer; | |
for(i=startIndex;i<endIndex+1;i++){ | |
const l = thisComp.layer(i); | |
if(l.inPoint <= time && l.outPoint > time){ | |
activeLayer = l; | |
break; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const startIndex = thisLayer.index + 1; | |
const endIndex = thisComp.numLayers; | |
let activeLayer; | |
for(i=startIndex;i<endIndex+1;i++){ | |
const l = thisComp.layer(i); | |
if(l.inPoint <= time && l.outPoint > time && l.source instanceof Comp){ | |
activeLayer = l; | |
break; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for (var selection, viewIDs = app.getProjectViewIDs(), i = 0; i < viewIDs.length; i++) | |
if (app.getProjectFromViewID(viewIDs[i]).name == app.project.name) { | |
selection = app.getProjectViewSelection(viewIDs[i]); | |
break | |
} | |
for (i = 0; i < selection.length;i++){ | |
var item = selection[i]; | |
var effect = item.videoComponents()[0]; | |
effect.properties[25].setValue(0); // set to REDgamma4 |
NewerOlder