Skip to main content
Premiopolis
Inspiring
April 15, 2023
Answered

How to get a maskPath.points() using valueAtTime()?

  • April 15, 2023
  • 2 replies
  • 507 views

Trying to achieve this:

thisMaskPath = thisComp.layer("LayerName").mask("Mask 1").points()[0][0].valueAtTime(0);
//or
thisMaskPath = thisComp.layer("LayerName").mask("Mask 1").points()[0].valueAtTime(0);
//or
thisMaskPath = thisComp.layer("LayerName").mask("Mask 1").points().valueAtTime(0);


All the above throw an error

The following:

thisMaskPath = thisComp.layer("LayerName").mask("Mask 1").valueAtTime(0);

returns an object, but then the following throw errors

thisMaskpath.points()[0][0];
thisMaskpath.points()[0];
thisMaskpath.points();



This topic has been closed for replies.
Correct answer Dan Ebberts

points() takes time as a parameter. Like:

p = thisMaskPath.points(0);

2 replies

Dan Ebberts
Community Expert
Dan EbbertsCommunity ExpertCorrect answer
Community Expert
April 15, 2023

points() takes time as a parameter. Like:

p = thisMaskPath.points(0);

Premiopolis
Inspiring
April 15, 2023

Thanks Dan.  Brilliant.... as always.

Mylenium
Legend
April 15, 2023

Masks never worked with valueAtTime() due to their compound keyframes. You may need to create Null objects to control the points and mangle those with expressions rather than the mask itself.

 

Mylenium