January 29th 2016 08:00:29am
Welcome to Free Function Friday. This week we build a function that will return an object containing the name, matchName, and category of all third party effects plugins installed in After Effects. If you are unfamiliar with the term, third party effects plugins are plugins that do not natively ship with After Effects when you purchase it.
These are plugins like Red Giant, Boris Continuum, Sapphire, Video CoPilot, and many others. Basically any plugin you had to buy separately from another company. As a side note of clarity, plugins are not scripts, so that means you will not see scripts listed at all with this function.
This function can be very helpful if you are needing to check if certain plugins are installed on a users machine that your script will require, or if you are checking to make sure all of your machines in the office have the same plugins installed. The last one has been handy for myself as I was trying to match all of the office machines, to make sure a project could be rendered on any machine without issue.
This function is built in a way that it eliminates stock plugins that come with After Effects. The list is based on key words and character groups in the plugin match names. This list can be manually altered at any point if After Effects decides to add or remove any plugin, so currently it should cover nearly all of the stock plugins that I was able to define on my own. I did my best, but I certainly may have missed a name or two, so you may wanna verify that it finds ALL of your third party plugins properly before using it in a script that’s meant for public use.
Source Code:
var e = getThirdPartyFX();
var eLen = e.length;
var r = new Array();
for(var i=0; i<eLen; i++){
r.push(e[i].dn);
}
alert("3rd Party FX:\r" + r.join("\r"));
/* TESTING ABOVE */
function getThirdPartyFX(){
try{
var allEffects, allEffectsLen, curEffect, thirdPartyList;
allEffects = app.effects;
allEffectsLen = allEffects.length;
thirdPartyList = new Array();
for(var e=0; e<allEffectsLen; e++){
curEffect = allEffects[e];
if(curEffect.matchName.match(/^CC |CINEMA|ADBE|SYNTHAP|EXtractoR|IDentifier|CS ?|APC|Keylight|ISL|Mettle|VISINF|GLRE/) == null){
thirdPartyList.push({'dn': curEffect.displayName, 'mn': curEffect.matchName, 'cat': curEffect.category});
}
}
if(thirdPartyList.length > 0){
return thirdPartyList;
}else{
return null;
}
}catch(err){alert("ERROR:\nError at line #"+err.line+"\n\nErr: "+err.toString());};
}