-
Automated Title with expression via Essential Graphics
Hello my friends,
I have a problem which is very complex in my point of view. I´m a rookie in writing expressions but I become better and try to learn as much as I can. I hope you can understand what I´m trying to explain because I´m no native speaker….Now to my case.
I´m planning to build a title for Premiere CC, which should be provided there via Essential Graphics, but it´s made in After Effcts.
The title does the following: You can write down the name of a Photo-Owner or a origin/source of videomaterial,e.g. “Photo:” …your text here…
The “Photo” or “source”-text is not editable in the Premiere-title, it´s give by default.We use a company default font. What I did is to restrict the maximum letters to 40 lettes via “text.sourceText.substr(0,40);”-expression. It works fine. I managed to re-position the text in dependence to the length of the written text of the editor in Premiere CC, I did this via “sourceRectAtTime”, although I realized that it is only an approximation of the real text length. Is that right? The expression for that is:
textweite = thisComp.layer(“Filmausschnitt: “).sourceRectAtTime().width;
x = thisComp.width-textweite;
y = position[1];
[x,y];what I want to reach is something like this:
x = thisComp.width-textweite/((100/transform.scale[0]))-effect(“Einstellungen für Schieberegler”)(“Schieberegler”);
// comment: trying to find a formula to connect scale and x-Position, more letters=less than 100% scaleif (thisComp.layer.position[0]<1436 ) [1436, y] else(); // comment: X Position nailed to the centre of the screen
So far so good.
But now I have to go further. And here starts the Problem. I need to restrict the Position of the text to the middle of
the HD-Screen, and I realized that I can´t read out the amount of pixels given by the specific text, e.g an "W" has more pixels than an "i". But I need exact data to restrict it to the middle of the screen.
An extra would be, to scale down to text automatically when the middle of the screen is reached, so that you can place even longer text, maybe more than the 40 letters, which I use now as a restriction for the moment.Now to my questions:
How can I restrict the text to stop at the middle of the screen?
Does "SourceRectatTime" give me the correct amount of pixels of the text(I tried some code an it seems not..)?
How can I translate the length of the written text to the scale-parameter, so that it holds the position in the middle
of the screen while it´s getting smaller(in dependance to the extra letters written down, e.g. 50 or more letters.I really hope you understand what I mean.
I´m excited which ideas you have,
yours, Matthias