ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Is it possible to change a photo image via .txt $.eval or any other form that doesn't require a script

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Scott McGee
Is it possible to change a photo image via .txt $.eval or any other form that doesn't require a script
on Jun 29, 2017 at 3:11:02 pm
Last Edited By Scott McGee on Jun 29, 2017 at 3:48:54 pm

...Edit....

Damn it, finally found someone asking the exact same question.
https://forums.creativecow.net/thread/227/33364

Unless something has changed in the last year, I'm guessing the answer is still not possible.


....Edit.....


Is this possible?

I have an image in a folder.

1 - John Smith.png

I've imported this into my AE comp, and use an expression to pull the name from the layer so my Text layer pops up John Smith.

This is where the realms of "Is it possible" comes in.

If I replace the image in the folder with.

1 - Aaron Taylor.png

when I open after effects, I want 1 - John Smith.png to replace itself and the Text layer now to say Aaron Taylor.

I know there are scripts where I can click a button and I can reference 1 -, to replace the image layer, but I can't use a script. I need it to replace itself some other way, similar to using an $.evalFile(myPath) with a txt file. Even if I can use a .txt file so it can replace itself based of reference like that would be also a way I would want to try.

I know if I label it 1 and replace it with another file called 1. That will work. but I need the name to appear in the text, without someone manually having to put it in. I can't find anything that might suggest this without the aid of a script, which is a pain, because a script would require someone to physically launch the script, which again I need it to do it without Manually updating it.


Return to posts index

Dan Ebberts
Re: Is it possible to change a photo image via .txt $.eval or any other form that doesn't require a script
on Jun 29, 2017 at 3:58:20 pm

I don't believe it's possible.

Dan



Return to posts index

Scott McGee
Re: Is it possible to change a photo image via .txt $.eval or any other form that doesn't require a script
on Jun 29, 2017 at 5:53:30 pm

I thought as much.

Thank you


Return to posts index


Scott McGee
Re: Is it possible to change a photo image via .txt $.eval or any other form that doesn't require a script
on Jun 29, 2017 at 7:13:42 pm

It's not the way I like to do things, but...

By replacing the image with another image of the same name, that replaces the image no problem. Then my text layer references a .txt document using $.eval that you type the name into.

It's not great, but everyday an image has to be selected, so as much as I would like them to just rename the file by using something like 1 - John Smith to grab a reference. Opening a text document and Inputing a name. Then it replaces the name, at least that works.

So it's not great and I read that you yourself didn't like this method, but I can't have them opening the .aep file. This is to sit on a machine, in a corner collecting dust whilst CMD prompt launches AE and exports my project with the new inputed data from a .txt file created from an API developer.

The only time it needs to be touched, if something goes wrong, which my demo version is working smoothly. So I'm feeling very positive.

Who says you can't create your own weather generator from 0p hahaha


Return to posts index

Dan Ebberts
Re: Is it possible to change a photo image via .txt $.eval or any other form that doesn't require a script
on Jun 29, 2017 at 8:13:58 pm

A command prompt can launch a script, so maybe that would help.

Dan



Return to posts index

Scott McGee
Re: Is it possible to change a photo image via .txt $.eval or any other form that doesn't require a script
on Jun 30, 2017 at 5:33:32 am

Woah, you just broke my mind.

I didnt' t know you could launch a script via command. I'm looking forward to trying that out.

In that case how would you suggest this then.

because the script doesn't want to be updated manually for the filepath e.g John Smith - 1.png to Aaron Taylor - 1.png or 1 - John Smith.png to 1 - Aaron Taylor.png

What would I be best off using. I'm so used to using different methods indexOf or Substr to get this, my brain is struggling to compute that this would even work.

I can't think of a good way to work this.

/Users/username/Desktop/1 - " ".png
or
/Users/username/Desktop/" " - 1.png

Because there will be only the one picture in the folder. I guess indexOf and just look for 1.png.


Return to posts index


Dan Ebberts
Re: Is it possible to change a photo image via .txt $.eval or any other form that doesn't require a script
on Jun 30, 2017 at 6:25:23 am

You could drop a text file (with a fixed name known to the script) into a known folder (maybe the same folder as the replacement file). The text file would contain the name (or path) of the replacement file. You'd do this before sending the command. Once the script launches, it would read the text file and make the substitution. I've done it with XML and JSON files, but a simple text file should work as well.

Dan



Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2017 CreativeCOW.net All Rights Reserved
[TOP]