Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Activity Forums Adobe After Effects Expressions external information from .txt/.php file issues

  • external information from .txt/.php file issues

    Posted by Joe Den helder on July 1, 2012 at 8:37 pm

    Hello, I’ve been working on a project (within AE CS5)and ended up having some issues.

    I ‘read’ the opacity from a little bit of code in AE, which is used as an expression on a layer:

    myPath = “/c/map/textinformation.txt”;
    $.evalFile (myPath);
    eval(thisLayer.name)[0];

    with this layer (with the name: sunset) it will look for this information:

    sunset = [0]

    the opacity of the layer is now 0 and it works fine.

    However, I want AE to figure the location of textinformation.txt for it self as in:

    myPath = “textinformation.txt”;
    $.evalFile (myPath);
    eval(thisLayer.name)[0];

    This will work good in AE, but when it renders, all of the sudden it doesn’t any more (the layer’s opacity will automatically be 100, even if it’s set 0)

    It has to be something like:

    myPath =”thismap.textinformation.txt”; (i’m a noob at this lol)

    Any thoughts?

    Dan Ebberts replied 14 years, 2 months ago 2 Members · 6 Replies
  • 6 Replies
  • Joe Den helder

    July 1, 2012 at 9:30 pm

    I figured out that this does work in After Effects.

    But when i try to render it out with the AE render engine (by collecting files + storing the .txt/.php files in the same folder) all of the sudden AE won’t display the text written in the .txt/.php and the original text will show up in the composition.

    If I use a absolute path however (myPath = “/c/folder/folder/Textfile.txt”;)

    It will work in AE and with the render engine. This is what i write in the text file:

    Comptext:

    text01 = [“Text 01”]
    text02 = [“Text 02”]
    ;

  • Dan Ebberts

    July 1, 2012 at 10:51 pm

    So, problem solved?

    Dan

  • Joe Den helder

    July 1, 2012 at 11:08 pm

    Not yet 🙂

    The render engine doesn’t seem to support relative paths in expressions. So im still trying to figure out how I can tell AE to search in the folder it is in.

    As in:

    myPath =”Check out this folder.textinformation.txt”;

    Or this.textinformation.txt.

    I basically want to avoid an absolute path..

  • Dan Ebberts

    July 1, 2012 at 11:43 pm

    The ablility to read text files with expressions is really just an unintended hack (as far as I know). I don’t believe it’s robust enough to do what you want.

    Scripting can easily get the path to the current project (app.project.file.path), but expressions just don’t have access to those objects.

    Dan

  • Joe Den helder

    July 2, 2012 at 1:27 am

    Wow great response, thanks!

    Do you think the thing i’m trying to accomplish is possible by scripting?

  • Dan Ebberts

    July 2, 2012 at 4:45 am

    It depends on your workflow. Expressions create a live connection, but scripts are run manually (to set something up, or after you change something). It just depends on what you need to do exactly.

    Dan

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