Skip to main content
Participant
March 12, 2013
Question

Adding an expression to Source Text breaks alignment?

  • March 12, 2013
  • 13 replies
  • 4843 views

This is a big WTF for me.

I have a text layer. I center-align the text in it. The moment I add an expression to its Source Text (even the default text.sourceText) it becomes left-aligned and REFUSES to go to center-aligned. Huh?! This seems like a very common thing, so what am I missing? Is there something else I need to do in the expression to get it to be center aligned?

Thanks!

This topic has been closed for replies.

13 replies

Participant
October 15, 2024

I had the same issue recently. I have text that I want to set dynamically based on an expression control in another composition. The paragraph align was stuck on centered. If I removed the expression from the Source Text, I could change the alignment, but as soon as I added the expression back in, the alignment went back to centered. I need it to be left aligned.

 

I followed @leif_hanson's advice, which was to clear out the manually-entered text for the text layer. This did the trick! I was able to make manual changes to the paragraph alignment. 

emmab86471458
Known Participant
June 6, 2024

Hi there, I'm still having that issue on After Effects 2023 ! 😞

Inspiring
July 9, 2023

It's 2023 and this is still an issue! Adobe! Please fix!

Participant
January 8, 2024

2024 and still broken. Adobe is worthless.

Participant
April 6, 2015

Oh man.  Hopefully you figured this out already, but it was driving me crazy too.  But I think I've got it figured out.  I added a sourceText expression and was unable to change the alignment, but after much futzing I found that by deleting the existing text in the text layer I was applying the expression to, I could change the alignment without any issues.  I hope that's clear. 

Participant
June 10, 2022

I love you

June 6, 2013

Experiencing the same issue here with CS6: text-alignment breaks after adding an expression on the source text.

Any solution found already?

Inspiring
June 7, 2013

It depends on the expression you're using. Post it here to see if we can see what's causing the issue.

June 11, 2013

I use this expression:

type = text.sourceText;

m = thisComp.marker.nearestKey(time);

sentences = type.split("\r");

n = m.index;

if (time < thisComp.marker.nearestKey(time).time) {n = n-1}

if (n>=sentences.length){n=sentences.length-1}

if (n<1){n=1}

line = sentences;

line

When I edit the text, it's perfectly aligned, but when the text gets split up by the expression, everything aligns to the left.

Hope you have an idea why?

Dan Ebberts
Community Expert
Community Expert
March 12, 2013

I'm not seeing that behavior (the expression text stays center-justified). What version of AE?

Dan