Skip to main content
tardigrade01
Inspiring
April 27, 2016
Answered

Top/Left Value of Point Text Relative to Composition?

  • April 27, 2016
  • 2 replies
  • 1404 views

So since the width and height of a point text layer is

--always the size of the composition

--calculateTransformFromPoints can only set and not read a set of values

-- a point text layer's sourceRectatTime top and left values (as well as baselineLoc values)  are relative, as far as I can tell, to its... anchor point? And

-- I can't rely on its anchor point since a) end users move the anchor point and b) we have other functions that periodically center the anchor point of every layer,

I was wondering if there were some other way to calculate the top and left values of a point text layer relative to the composition?

Do I have to draw a mask that is the full size of the layer and then derive the values from its vertices?

This topic has been closed for replies.
Correct answer Mathias Moehl

sourceRectatTime gives you the corners in layer space. Unfortunately scripting has no build-in function to convert layer space to comp space (expressions have it). Either you can hack using expressions (create an expression that computes the layer to comp space calculation and read its value) or you need to implement it yourself (i.e. recursively going over the layer and all its parents transform properties and compute how they change the position).

2 replies

Mathias Moehl
Community Expert
Mathias MoehlCommunity ExpertCorrect answer
Community Expert
March 1, 2017

sourceRectatTime gives you the corners in layer space. Unfortunately scripting has no build-in function to convert layer space to comp space (expressions have it). Either you can hack using expressions (create an expression that computes the layer to comp space calculation and read its value) or you need to implement it yourself (i.e. recursively going over the layer and all its parents transform properties and compute how they change the position).

Mathias Möhl - Developer of tools like BeatEdit and Automation Blocks for Premiere Pro and After Effects
tardigrade01
Inspiring
March 1, 2017

Thanks. Ugh. This is what I was afraid of. I have been trying sourcePointToComp() but I can find no documentation anywhere as to what parameters this method should take. comp.layer(1).sourcePointToComp() certainly doesn't work.

tardigrade01
Inspiring
March 1, 2017

oh, never mind. I see that you should pass boxTextPos

tardigrade01
Inspiring
March 1, 2017

bueller?