Beenden
  • Globale Community
    • Sprache:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티

Top/Left Value of Point Text Relative to Composition?

Beitragender ,
Apr 27, 2016 Apr 27, 2016

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?

THEMEN
Skripterstellung
1.4K
Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines

correct answers 1 richtige Antwort

Community Expert , Mar 01, 2017 Mar 01, 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).

Übersetzen
Beitragender ,
Mar 01, 2017 Mar 01, 2017

bueller?

Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines
Community Expert ,
Mar 01, 2017 Mar 01, 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
Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines
Beitragender ,
Mar 01, 2017 Mar 01, 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.

Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines
Beitragender ,
Mar 01, 2017 Mar 01, 2017

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

Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines
Fürsprecher ,
Mar 01, 2017 Mar 01, 2017

You can use sourcePointToComp this way:

var time = comp.time;

var rect = comp.layer(1).sourceRectAtTime(time, false);

var pos = comp.layer(1).sourcePointToComp([rec.left, rect.top]);

Oddly enough, it doesnt take a time parameter, only a 2D point.

So you should set the comp.time to the one you want before using.

Xavier

Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines
Beitragender ,
Mar 01, 2017 Mar 01, 2017
AKTUELL

thanks. I ended up passing sourceText.value.boxTextPos but I need to handle keyframe values, so it looks like sourceRectAtTime() will be the  way to go

Übersetzen
Melden
Community-Richtlinien
Seien Sie freundlich und respektvoll, geben Sie die ursprüngliche Quelle der Inhalte an und suchen Sie vor dem Absenden Ihres Beitrags nach Duplikaten. Weitere Informationen
community guidelines