Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions One expression that will work on one dimension or two?

  • One expression that will work on one dimension or two?

    Posted by Kevin Snyder on October 21, 2021 at 4:58 am

    I’m trying to come up with an expression that will work on properties that have one dimension or two dimensions. Here’s what I can up with, but it doesn’t work. I still get an error message. Maybe the catch(err) technique doesn’t work in this case?

    temp = thisComp.layer("Drive").effect("Drive")("Output 01");

    try{

    [temp, temp];

    }catch(err){

    temp;

    }

    Kevin Snyder replied 4 years, 7 months ago 2 Members · 2 Replies
  • 2 Replies
  • Dan Ebberts

    October 21, 2021 at 6:46 am

    Try it this way:

    temp = thisComp.layer("Drive").effect("Drive")("Output 01");

    dim = value instanceof Array ? value.length : 1;

    dim > 1 ? [temp,temp] : temp

  • Kevin Snyder

    October 21, 2021 at 2:49 pm

    That works great. Thank you.

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