Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Scaling units: pixels instead of percent?

  • Scaling units: pixels instead of percent?

    Posted by Kirk Smith on May 5, 2009 at 11:13 am

    I have a need to call to the scale attribute of a text layer using an expression. I’m trying to make a versatile setup for some particle effects that will let me change the text layer used without having to edit any numbers. The problem is, when I select the text layer and hit S (for scale) it brings up the scale in percent, I need it in pixels. There has to be a way I can make it let me call the pixels values of each scale, but I can’t find it anywhere. Iv’e tried the expression:

    thisComp.layer(“[my text layer]”).height

    But that just gives me 720, the height of my comp…not the text layer. The text layer is 33.2276 pixels high and 369.24719 pixels wide. Please, someone help me out!

    Kirk Smith replied 17 years ago 3 Members · 3 Replies
  • 3 Replies
  • Adriano Moraes

    May 5, 2009 at 2:17 pm

    I guess you can right click the property and click Edit Value on the menu.

    In there you choose units to be pixels.

    The problems is you´ll have to do everytime since the value on the timeline still maintain the regular percent.

    Did it help?

    Cheers.

    ninguem.

  • Bartek Skorupa

    May 5, 2009 at 3:55 pm

    thisComp.layer(“[my text layer]”).height

    The point is that the height of any text layer equals the height of the comp it is in.
    It is always so. The height of the letters doesn’t matter.

    I would suggest pre-composing the text and then play a bit with the math to get what you want.

    For example:

    a = thisComp.layer(“[name of precomp]”);
    h = a.height;
    s = a.transform.scale[1];
    h*s/100

    Bartek Skorupa
    Warszawa, Poland

  • Kirk Smith

    May 5, 2009 at 9:54 pm

    @adriano: no, that’s not what I wanted. I need to be able to pickwhip the pixel height and width of the text layer into a particle emitter’s height and width.

    @bartek: I suppose that’s what I’ll have to do. I tried moving around the anchor point and doing some math. I’d move it to the top left and I’d do something like this:

    tX = thisComp.layer(“my text layer”).position[0];
    cX = thisComp.height;

    ((cX / 2) – tX) * 2

    And that would give me close to the height and width of the text, but it wasn’t perfect.

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