-
Help Needed – Check if layer’s mask has keyframes in maskpath
Hello everyone, I am trying to create an error check button that finds and alerts about layers with no keyframes in their mask’s maskpath.
This is my code so far-
var project = app.project; /// Get project data
var currentComp = project.activeItem; /// Get Active comp
var allLayers = currentComp.layers; /// Get all layers – array
var numOfLayers = allLayers.length; /// Gets length – integer
var errorArray = []; /// Create an empty error array
for(i=1;i<numOfLayers+1;i++) /// iterate through all layers
{
var currentLayer = allLayers[i]; /// Get layer from position i
var myMask = currentLayer.mask(1);
var myProp = myMask.maskPath;
if(myProp .isTimeVarying==false)
{
errorArray.push(currentLayer.index);
}
}
if(errorArray.length==0)
{
alert(“0 Layers with no keyframes”);
}
else
{
alert(“Layers #”+errorArray.toString()+” has no keyframes”,”Error”);
}
Sadly it isn’t working, I would love some help understanding where I got it wrong and also if there’s another way to do it.
Thanks, Tom. 🙂