Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions solidFill/opacity numKeys problem SCRIPTING

  • solidFill/opacity numKeys problem SCRIPTING

    Posted by Rainier Raydán on December 3, 2017 at 3:34 pm

    Hi guys! I’m doing a simple for loop through items, layers and properties. This for loop have to tell me if those layers have the property “solidFill/opacity” and if it has keyframes. I did it like this:

    var curItem = null;
    var curLayer = null;

    for(i=1;i<=app.project.numItems;i++){
    curItem = app.project.item(i);
    for(a=1;a<=curItem.numLayers;a++){
    curLayer = curItem.layer(a);
    dumpPropTree (curLayer);
    }
    }

    function dumpPropTree(rootObj) {
    var countProps = rootObj.numProperties;
    for (var propIndex=1; propIndex <= countProps; propIndex++) {
    var prop = rootObj.property(propIndex);
    var propMatchName = prop.matchName;
    if(propMatchName == "solidFill/opacity" && prop.numKeys>0){
    alert("Item = " + curItem.name + "\rLayer = " + curLayer.name + "\rProperty = " + prop.name + "\rNumKeys = " + prop.numKeys);
    }
    if (prop.numProperties > 0){
    dumpPropTree(prop);
    }
    }
    }

    the problem is that it alerts me with this

    Has you can see, there’s no opacity property there with keyframes but the alert tell me another thing. Is there something I’m missing here?

    Thanks!

    Rainier Raydán replied 8 years, 5 months ago 2 Members · 2 Replies
  • 2 Replies
  • Andrei Popa

    December 6, 2017 at 9:19 am

    Maybe it tells you about layer 4? It has the same name, maybe that has opacity keyframes.

    Andrei
    My Envato portfolio.

  • Rainier Raydán

    December 18, 2017 at 1:46 pm

    no… it’s not 🙁

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy