Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions Access text of a pre-comp from outside

  • Access text of a pre-comp from outside

    Posted by Dennis Dillert on May 27, 2009 at 11:12 pm

    Hi guys,

    is there a way to change the contents of a text field using expressions? And if there is, how can you access a text field from outside of a pre-comp layer?

    Basically, I have one pre-comp with several text fields inside and I want to re-use this template for other things, but I’m too lazy to manually adjust all the individual text fields everytime.

    Thanks
    Dennis

    Koby Goldberg replied 16 years, 11 months ago 3 Members · 4 Replies
  • 4 Replies
  • Stuart Elith

    May 28, 2009 at 2:34 am

    Hey Dennis,

    You can certainly access stuff in other comps, but (as far as I know) you need to reference that comp by name, so if you are doing something where you will always be changing all the names, it may be more hassle than it’s worth (though it still may be worthwhile).

    So lets say you have a comp, “Container”, and in there is a precomp and some text layers with the text you want to use.

    Inside your precomp you have the text fields, and you need to twirl down to teh Source Text attribute, and add this (i like to do it by pickwhip, you need to undock the container comp so you can see both comps at once and pick the attribute….)

    comp(“Container”).layer(“Text One”).text.sourceText

    So it’s pretty straightforward, and clearly you can change the names of your layers and comps as needed.

    I haven’t tried taking it any further and generating the text more dynamically or whatever, but it may be possible, not sure.

  • Dennis Dillert

    May 28, 2009 at 3:45 am

    Thanks Stuart, tried it and it works. So now I’m able to copy text from one textfied into another one.

    I have even taken it a step further and am now assigning the text through Expressions, which is great. Now second question:

    Is there a central place where I can store my expressions, so I don’t have to create additional text layers?

    I have posted the expression that works below, but I am still dependent on using another text layer’s source property to insert the expression.

    comp(“Target Comp”).layer(“Text1”).text.sourceText = “This could be some text in here”

    comp(“Target Comp”).layer(“Text2”).text.sourceText = “.. and this would be the second text.”

  • Stuart Elith

    May 28, 2009 at 4:08 am

    Yeah, that’s what i was getting at at the end of my post, about maybe doing it in a more streamlined way… i’m not really sure.

    I am interpreting your question as being : Can you put the text you want to use in something other than a text layer (in other words, having all the text in one box or something, and just borrowing what you need). Is that what you are asking?

    I think this could be done using scripting… you could probably end up with something where you select the script, enter in what you want and choose where it goes. But that is beyond my skills, and seems like it would take more time than it saves. In my mind, having a bunch of text layers which drive the precomps is efficient enough, you can just put them at the bottom of your timeline, out of the way.

    So short answer is, probably possible, not by me though!

  • Koby Goldberg

    May 28, 2009 at 5:58 am

    Check out this post on AEnhancers.com
    https://aenhancers.com/viewtopic.php?f=3&t=1083
    perhaps it could help you.

    Koby.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy