Skip navigation
manuruch 3 posts
Mar 16, 2012
Currently Being Moderated

How to calculate the 4 corners of a text layer?

Mar 16, 2012 7:11 AM

Tags: #text #coordinates #corner

Hello

 

I need to know how to translate the size of a text layer to get the coordinate of his corners. My need is to be able , in an automatic way, to give a solid the size of a text. For exemple if i write a longer text, the solid increases his size.

I tried this expression but AE (10.0.1) notified me that the Source's function is not defined.

 

var r = thisComp.layer("Layer").sourceRectAtTime(0, false);

alert(r.top + " " + r.left + " " + r.width + " " + r.height);

 

Any idea?

 
Replies
  • Currently Being Moderated
    Mar 16, 2012 9:02 AM   in reply to manuruch

    Yes, it's only available in scripts, not expressions. There is no way for expressions to simply grab the rasterized pixels of a text or shape layers and use them as dimensions. Check AEnhancers, there's some old code floating around that involves sampleImage() to test for extents of such layers.

     

    Mylenium

     
    |
    Mark as:
  • Currently Being Moderated
    May 15, 2012 1:24 PM   in reply to manuruch
     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points