Can Extendscript see if an effect is missing?

New Here ,
Oct 12, 2017 Oct 12, 2017

Copy link to clipboard

Copied

My coworkers asked me to write a script that finds which layers have missing effects. I can search through every layer > every comp > Effects property > return every effect. I was hoping the name value would match how it's displayed in the timeline (e.g., "Missing: Edge Blur"), but it just displays the effect's name ("Edge Blur"). Is there any property that would return a value that would tell you whether the effect is missing or not?

TOPICS
Scripting

Views

491

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Oct 13, 2017 Oct 13, 2017

Copy link to clipboard

Copied

One way to go about it is to collect all installed effects and then loop through to see if effects in question is in the array;

var effectInQuesstion = "ADBE Blend";

var installedEffects = getInstalledEffects();

if (contains(installedEffects, effectInQuesstion)) {

    alert("Effect " + effectInQuesstion + " is installed");

} else {

    alert("Effect " + effectInQuesstion + " is not installed");

}

function getInstalledEffects() {

    var installedEffects = [];

    for (var i = 0, il = app.effects.length; i < il; i ++) {

        installedEffects.push(app.effects.matchName);

    }

    return installedEffects;

}

function contains(array, string) {

    for (var i = 0, il = array.length; i < il; i ++) {

        if (array === string) {

            return true;

        }

    }

    return false;

}

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Oct 13, 2017 Oct 13, 2017

Copy link to clipboard

Copied

Thanks for the reply Tomas, but I'm not sure if this solution will work. After Effects lists the missing effects in app.effects. Interestingly, it lists them even when I open a new project that doesn't use the missing effects. It looks like app.effects keeps a list of every effect that your AE installation has encountered, even the missing ones.

According to the documentation, objects under app.effects have 4 properties you can call: displayName, matchName, category, and version. The names obviously won't help you determine if something is missing.  Missing effects don't have a category, but neither do presets or effects that are created from outside of the Effects & Presets menu (e.g., DUIK effects). Missing effects have a version number of 0.0x0, but so do a lot of third-party effects. So I don't see how any of those will help.

However, I did come across this script (pt_EffectSearch 3) which is able to distinguish missing effects, so there has to be a solution somewhere.

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 05, 2022 Jun 05, 2022

Copy link to clipboard

Copied

Hey, are there any updates or ideas how to get the missing effects?

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Jun 06, 2022 Jun 06, 2022

Copy link to clipboard

Copied

LATEST

So I did some tests and I am pretty sure, that pt_EffectSearch 3 finds the missing effects by assuming that they all have no category and the version number 0.0x0. It happens to be that some Adobe Effects do match this creteria, but if you add a condition that effects which matchNames start with "ADBE" dont't count as missing, I get the exact same results as pt_EffectSearch 3 so far.

 

Still, pseudo effects added by binary code (as by DUIK) are still counted towards the missing effects (in ptES3 and my tests), even though After Effects does not list them as missing.

 

Just wanted to add my thoughts to this 🙂

Likes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines