Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Assignment to properties in After Effects

  • Assignment to properties in After Effects

    Posted by Sanjay Kapoor on January 25, 2015 at 5:18 pm

    Can you do something like this:

    thisComp.layer(“Print Statement”).text.sourceText = time;

    In After Effects?

    My code isn’t seeming to work with this, and I’m wondering how I can’t change the code so that one of the values in my expression “prints” to a Text field called “Print Statement” so that I can debug it.

    Any ideas?

    thisComp.layer("Print Statement").text.sourceText = time;

    Dan Ebberts replied 11 years, 7 months ago 2 Members · 3 Replies
  • 3 Replies
  • Dan Ebberts

    January 25, 2015 at 5:42 pm

    An expression can’t affect anything except the property that actually hosts that expression. It can’t send values to other layers/properties–those properties would have to have their own expressions.

    Dan

  • Sanjay Kapoor

    January 26, 2015 at 1:57 am

    I was looking for a way to “print” the value of a variable, and my idea was to set the text of a text object to be equal to that variable (in the expression).

    Is there any way to check the value of a variable for the purposes of debugging like this?

  • Dan Ebberts

    January 26, 2015 at 7:42 am

    You can apply the entire expression to a text layer and at the end of the expression you can add the variable you want to see. You may have to edit the expression somewhat (if it references other properties of the host layer). It’s far from ideal, but I do it often and find it very useful if I’m trying to track down a mysterious problem.

    Sometimes I’ll use a slider control the same way, because then it’s less likely you’ll have to edit the expression (although you do need to make sure the result is a 1D value).

    Dan

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