Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Text layer that displays another layer’s X, Y and Z points?

  • Text layer that displays another layer’s X, Y and Z points?

    Posted by Adam Bennett on September 21, 2005 at 8:42 pm

    I thought I had got the hang of (very basic!!) expressions, but I can’t work out what I need to do to get this.

    Please help!!
    Many thanks in advance people

    Adam Bennett replied 19 years, 2 months ago 2 Members · 4 Replies
  • 4 Replies
  • Dan Ebberts

    September 21, 2005 at 9:17 pm

    Well, in its basic form it would look something like this:

    P = thisComp.layer(“other layer”).position;
    P[0] + ” ” + P[1] + ” ” + P[2]

    but you might want to add rounding and/or other formatting.

    Dan

  • Adam Bennett

    September 21, 2005 at 10:05 pm

    Thanks Dan. I suspected you’d know!!

    You’re right I would like to round the values up to the nearest whole number. I tried adding this:

    Math.round(P)

    to the end, but it hasn’t worked. Can you tell me what I’m doing wrong?

    Many thanks

  • Dan Ebberts

    September 21, 2005 at 10:34 pm

    You have to round each of the pieces:

    P = thisComp.layer(“other layer”).position;
    Math.round(P[0]) + ” ” + Math.round(P[1]) + ” ” + Math.round(P[2])

    Dan

  • Adam Bennett

    September 21, 2005 at 11:03 pm

    Dan you’re a star and a certified genius!! Thank you

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