Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects EXPRESSION QUESTION – “thisMask”? A way to reference a mask on the layer the expression is on?

  • EXPRESSION QUESTION – “thisMask”? A way to reference a mask on the layer the expression is on?

    Posted by Ty Christian on April 27, 2018 at 5:37 pm

    Hey guys!

    Newbie here, so bear with me. I’m using the following expression:

    if(mask("Mask 19").maskOpacity==0)thisComp.layer("FakeSolid").mask("Mask 1").maskPath else mask("Mask 19").maskPath

    For a LARGE number of masks (around 70). The expression is working great, but after pasting the expression on the next mask (i.e. mask 20) I have to go in and manually change the name of the mask from “Mask 19” to “Mask 20”.

    Wondering if there’s a way to have it reference itself instead of the name of a mask? Something like “thisMask”?

    Thanks in advance for the help!

    Kalleheikki Kannisto replied 8 years, 3 months ago 2 Members · 1 Reply
  • 1 Reply
  • Kalleheikki Kannisto

    April 29, 2018 at 7:25 am

    New territory for me, but possibly like this. The first line returns the name of the parent of the property, which should be the name of the mask. The second line returns the mask with the same name from either this layer or the “FakeSolid” layer depending on whether the mask opacity is zero or not.

    p = thisProperty.propertyGroup(1).name;
    if(mask(p).maskOpacity==0)thisComp.layer("FakeSolid").mask(p).maskPath else value

    Kalleheikki Kannisto
    Senior Graphic Designer

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