ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

solidFill/opacity numKeys problem SCRIPTING

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Rainier Raydán
solidFill/opacity numKeys problem SCRIPTING
on Dec 3, 2017 at 3:34:11 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!


Return to posts index

Andrei Popa
Re: solidFill/opacity numKeys problem SCRIPTING
on Dec 6, 2017 at 9:19:40 am

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

Andrei
My Envato portfolio.


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]