Display Expression Code in Comp

New Here ,
Aug 06, 2020

Copy link to clipboard

Copied

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!

 

 

TOPICS
Expressions

Views

61

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Most Valuable Participant ,
Aug 06, 2020

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
lasdoug AUTHOR
New Here ,
Aug 06, 2020

Copy link to clipboard

Copied

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!

 

 

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Most Valuable Participant ,
Aug 06, 2020

Copy link to clipboard

Copied

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

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
lasdoug AUTHOR
New Here ,
Aug 07, 2020

Copy link to clipboard

Copied

Thanks for replying! 🙂

 

I'm not trying to display the result of the expression - rather I'm trying to display the actual text of the expression itself. 

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Mylenium LATEST
Most Valuable Participant ,
Aug 07, 2020

Copy link to clipboard

Copied

Then rejig it - apply the code to a text layer, parse it in the actual property where it needs to go using eval() and at the same time also link it to your actual visible text layer.

 

Mylenium

Likes

Translate

Translate

Report

Report
Reply
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more