ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Setting a Mask Name as a variable

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Ryan Jones
Setting a Mask Name as a variable
on Oct 3, 2017 at 6:58:47 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


Return to posts index

Dan Ebberts
Re: Setting a Mask Name as a variable
on Oct 3, 2017 at 7:36:26 pm

This should work:

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


Dan



Return to posts index

Ryan Jones
Re: Setting a Mask Name as a variable
on Oct 3, 2017 at 7:38:45 pm

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

RSJ


Return to posts index

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