Creative COW SIGN IN :: SPONSORS :: ABOUT US :: CONTACT US
ADOBE AFTER EFFECTS: HomeForumBasicsExpressionsTutorialsPodcastsMotion GraphicsTrainingCinema 4DFAQ

Scaling units: pixels instead of percent?

COW Forums : Adobe After Effects

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>
Scaling units: pixels instead of percent?
by Kirk Smith on May 5, 2009 at 11:13:23 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!

Respond to this post   •   Return to posts index

Re: Scaling units: pixels instead of percent?
by Adriano Moraes on May 5, 2009 at 2:17:55 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.

Respond to this post   •   Return to posts index

Re: Scaling units: pixels instead of percent?
by Bartek Skorupa on May 5, 2009 at 3:55:09 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

Respond to this post   •   Return to posts index


Re: Scaling units: pixels instead of percent?
by Kirk Smith on May 5, 2009 at 9:54:24 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.

Respond to this post   •   Return to posts index

<< PREVIOUS THREAD   •   VIEW ALL THREADS   •   PRINT   •   NEXT THREAD >>


FORUMSTUTORIALSMAGAZINETRAININGVIDEOS - REELSPODCASTSEVENTSSERVICESNEWSLETTERNEWSBLOGS

© CreativeCOW.net All rights are reserved.

[Top]