Skip to main content
lasdoug
Participant
August 6, 2020
Question

Display Expression Code in Comp

  • August 6, 2020
  • 1 reply
  • 480 views

Hello!

 

I feel like there must be a real simple way to do this - but I'm having trouble figuring out how to display the actual expression text in a comp. I figure for tutorials it'd be super helpful to have the text in the comp update in real time as I'm typing it in!

 

Attached pic is the result I'm looking for - but to have the text in the comp update without me having to copy and paste everytime! I hope this is possible 🙂

 

Thanks!

 

 

This topic has been closed for replies.

1 reply

Mylenium
Legend
August 6, 2020

You could always simply link it with a

 

thisComp.layer("XYZ").text.sourceText.toString()

 

and similar. Realtime updating as you type is not possible, though. It's inherent in how AE evaluates property streams. As long as the expression editor is open the evaluation is suspended and the stream will expose it's default values or the last valid state it was in when it was entered.

 

Mylenium

lasdoug
lasdougAuthor
Participant
August 6, 2020

Hello,

Thank you so much for taking the time to reply 🙂

 

I'm a bit confused as to where to put that code - in the Source Text parameter, or in the parameter of the expression I'm trying to copy? When I put it in the Source Text parameter, it returns that it can't read the property 'sourceText of undefined'. I tried getting it to reference:

 

"thisComp.layer(""layer with expression I want to display").position.text.toString()"

 

I must be misreading your help!

 

Also, thank you for the clarification about the realtime updating as I type!

 

 

Mylenium
Legend
August 7, 2020

Of course you will need to adapt the code depending on what properties you reference. Position is always a value, so it's .value.toString(). Invoking other funktions like parseInt() to process numbers correctly or toFixed() to shorten decimals for beautification may also be required.

 

Mylenium