Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Setting a Mask Name as a variable

  • Setting a Mask Name as a variable

    Posted by Ryan Jones on October 3, 2017 at 6:58 pm

    Not sure if this is possible. I have a white solid I’m using as an alpha channel for a painful rotoing job. I have several masks and would like to name them 1-160 (there are 160 frames in this comp) and have the expression say if the timeline is at 50 frames, then Mask 50 will be 100% opacity and zero before and after.

    The manual expression I’m using now is– Mask name is “50” and the opacity of the mask is as follows
    f=50;
    x=timeToFrames(time);
    if (x==f){100}else{0}

    I’m trying to avoid changing the value of F for every mask. I’d rather just name it and have F pull the Mask name so I can just duplicate or cut/paste the expression without modifying it. Is this even possible?

    RSJ

    Ryan Jones replied 8 years, 7 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    October 3, 2017 at 7:36 pm

    This should work:

    f=parseInt(thisProperty.propertyGroup(1).name,10);
    x=timeToFrames(time);
    if (x==f) 100 else 0

    Dan

  • Ryan Jones

    October 3, 2017 at 7:38 pm

    Well, adding this to my little book of expression shortcuts. Thank you so much!

    RSJ

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