Highlighted

Script for automating replacement of images in 800 layer placeholders from folder of images

New Here ,
Apr 06, 2020

Copy link to clipboard

Copied

Trying to create a template for a virtual graduation ceremony for 12 high schools.  Number of graduates (photos & names) varies from 600 to 900 per school.  I'm envisioning a rotating ring of photos (layers) with the axis point off screen right or left so the pictures swing into view, pause for the name to be read, and then swing out of view as the one behind it comes into place.  Camera with depth of field to blur pictures in bg and in extreme fg as they exit screen.

 

I've built a prototype project as a test with 4 layers.  The big question is how best to accomplish the task of handling up to 900 layers!  I'm hoping that a folder containing all of the photos (with names already on ) which are numbered sequentially (000-999) could be referenced by a script to drop the image onto the corresponding layer (by index number?).

 

Am I crazy.... or is something like this possible?

TOPICS
How to, Import and export, Scripting

Views

418

Likes

Translate

Translate

Report

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

Script for automating replacement of images in 800 layer placeholders from folder of images

New Here ,
Apr 06, 2020

Copy link to clipboard

Copied

Trying to create a template for a virtual graduation ceremony for 12 high schools.  Number of graduates (photos & names) varies from 600 to 900 per school.  I'm envisioning a rotating ring of photos (layers) with the axis point off screen right or left so the pictures swing into view, pause for the name to be read, and then swing out of view as the one behind it comes into place.  Camera with depth of field to blur pictures in bg and in extreme fg as they exit screen.

 

I've built a prototype project as a test with 4 layers.  The big question is how best to accomplish the task of handling up to 900 layers!  I'm hoping that a folder containing all of the photos (with names already on ) which are numbered sequentially (000-999) could be referenced by a script to drop the image onto the corresponding layer (by index number?).

 

Am I crazy.... or is something like this possible?

TOPICS
How to, Import and export, Scripting

Views

419

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

Sure it's possible, but the bigger question will be how you plan on actually rendering those 900 layers. That is going to be a major nightmare. Even a few seconds of footage could take hours with all that DOF and stuff. For everything else you might want to start by checking AEScripts.com for the variaous footage replacment scripts and see if one already kinda does what you need. Likewise you will find a lot of scripts that create all sorts of 3D-ish layer arrangements, slideshow templates and whatnot. Otherwise anything from complicated JSON-based solutions to simply importing the images and using a script to stagger the layers in the timeline might be adequate, but I still think most importantly you need to get away from using 3D and DOF when you are talking those crazy numbers of layers.

 

Mylenium

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

The concerns of Mylenium are actual true - AE isn't even close to handle such amount of data.

But you have the option to drive the animation with external data. You don't need 900 layers but only those, which will be visible. You can drop in all images of the studens as image sequence and use time remap to display the correct portrait. AE will definetly handle 900 frames, but will lack in handling 900 images and will die with 900 layers.

 

Get into data driven animation, prepare your dropsheet, write the expressions, create some generic DOF background where nobody can tell any face and get the work done, instead of killing your AE and rendering for weeks.

 

*Martin

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

Martin - 

I like your suggestion!  I can see how to loop a short animation of a few photos.  I'm not sure how to write the expression to automate the selection of the frame from the image sequence in each of the photo layers? 

 

each photo layer will be static on the screen for 4 seconds, then animate off screen while the next animates on screen over 2 seconds.  so each photo layer would need to advance by the number of photos layers every 6 seconds once it is off screen. 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 09, 2020 0
Adobe Community Professional ,
Apr 09, 2020

Copy link to clipboard

Copied

I wouldn't write a script to handle all of the layers, I would create an animation preset based on the in and out point of a layer like this one:

https://www.dropbox.com/s/tewk9s88mpkmnou/flyInBounceDropOut.ffx?dl=0

This takes a layer, no matter what the size or scale of the layer and flys it in from the left side of the screen. It bounces to a stop, then just before the out point, it falls off the bottom of the screen.

 

Import all of your images, set the in point at zero, set the out point at 4 seconds, use the keyframe assistant to sequence the layers with a 10 or 15 frame overlap and you're done. 

 

An even better idea, and a much simpler way to handle that many images and turn them into a nice slideshow - Adobe Lightroom Classic. There are lots of options, some decent presets, and it's very quick. Unless you are being paid a bunch for this project After Effects is probably not the best choice. 

 

Even Apple's Photos app produces pretty amazing still image slide shows automatically. 

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 09, 2020 0
New Here ,
Apr 09, 2020

Copy link to clipboard

Copied

Thanks for the input Rick!  

 

I think the idea of looping a few layers and using time remap to select the frames from the image sequence will work.  I'm having trouble wrapping my head around the writing of an expression to handle the frame selection process.  

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

Rick, we are talking about 900 layers and addition texts (names) to each image. I doubt that AE will handle this in an acceptual way (I've seen comps filled with so many layers, that the comp-panel/timeline panel wasn't capable of displaying the layers itself) and that those other tools will be able to add text in an easy, automated way.

 

*Martin

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

KaminariTaiko,

I hardly used data driven animations yet, so I cannot really help.

Generally, you need a document (excel sheet, JSON?) which contains the image names (in your case just a number from 000 to 900) and according student names. You pull in those data to AE and use the image name as frame to access* with time remap and use the students name as source text on a text-layer.

To drive this - meaning to tell AE which data should be accessed at a given time - you might can use a slider, which animates from 0 to 1 with all the in-stop-out timings. Then you use loopOut("offset") to increase the slider in the exact same manner.

Finally you have to find a way to display the previous/next students, if they are visible in the frame - but this can be as easy as duplicate the main layer and offset it in time and position.

 

*if you can use a slider to access the data, you can also use the slider value to access the frame in time-remap. You don't even need the image names in the sheet, nor do you need them as variable in the expression, because student 1 is image 1 is frame 1 is slider value 1, and the same for all the others.

 

This sounds like a huge project, but with minimal animation and artwork, so the main work is the development of an working expression. Get into data driven animations, closely go through the expression reference (https://helpx.adobe.com/after-effects/using/expression-language-reference.html), watch tutorials. That's what I would have to do, if this would be on my desk 😉

 

*Martin

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
Apr 09, 2020 0
New Here ,
May 04, 2020

Copy link to clipboard

Copied

KaminariTaiko,

 

What route did you go to solve this problem? I have a similar need to create a slideshow for hundreds of students but was thinking of creating a different comp for each student. I think I have a solution to automatically generate a new comp with text elements (student's name, school, etc) using a script to access a CSV file. But the student image is proving to be difficult!

 

Did you use Martin's slider suggestion? Seems like it could work in your situation but will it will work in separate compositions?

 

Basically I need a way to autiomatically display the correct student photo acording to the text elements.

 

Thanks,

Rob

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 04, 2020 0
Adobe Community Professional ,
May 04, 2020

Copy link to clipboard

Copied

You could write a simple expression that pulled the layer name from the layer below. Apply this to a text layer and put it just above the layer with the student's name. This would require you to use the student's name for every photo.

 

The only other option I can think if is a JSON file that has all of the names and the photo file names in it.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 04, 2020 0
New Here ,
May 05, 2020

Copy link to clipboard

Copied

Thanks Rick!

 

I tried the expression option that pulled the layer name from the layer below (photo) and that works for the student’s name but if there are other text elements associated with that student (like a quote or school name) they would have to be pulled from a sepearate CSV.

 

The JSON file option might work though! I think I'd be able to generate a JSON file with all the text elements as well as the corresponding photo file name. In my test I was able to pull the text from the JSON and display them but how would you display the photo if I have it's file name? 

Likes

Translate

Translate

Report

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

Copy link to clipboard

Copied

You have to import all photos into your project and put them all into one comp. Then you can use the name to control opacity (layer names must be the same as file names, of course!).

Depending on the amount of images, this can break your AE.

Of course you can spread the photo amount through several comps, still you have to import them all and this can already be troublesome. 

Try it and if AE breaks import them as image sequence, as suggested in the beginning of this thread.

 

*Martin

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 05, 2020 0
Adobe Community Professional ,
May 05, 2020

Copy link to clipboard

Copied

Martin,

I'm not talking about hundreds of layers in a single comp. With 900 names for a school, a simple expression can pull the name of a student from the layer name of the photo and complete the composite. I would use a script to stack maybe 30 to 50 photos in a comp and throw a text layer above each one with the name, Throw an animation preset on each one of them that animated the layers into the frame, paused, and then brought in the next image. The last step would be to sequence the nested comps. 

 

When that is done the 20 or so comps created with the script could be brought into the main comp and sequenced. If the layers were all 3D and the appropriate overlap was made you would have a seamless comp with about a thousand images with names.

 

Another option would be to add the names to the images in Lightroom and export the images using Lightroom's tools. I do this with watermarks, you could do it with student names. At one point in time somebody is going to have to match up the photos with the names. This would be the most tedious part of the process unless the photographer that took the images worked like the school photographer in my local area that does thousands of senior photos locally does and the names are all attached to the images when they are processed. If I want senior photos of my daughter all I have to do is tell him I want one and he delivers an image from his archives complete with the name and class embossed or just the name in about 2 minutes with a single click.

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 05, 2020 0
darrenM LATEST
New Here ,
Oct 30, 2020

Copy link to clipboard

Copied

Hi Kaminari, how did your project go?  I'm in the exact same situation right now and would appreciate any guidance.  Before seeing this post, I have a Json file and have text changing but I'm also stuck on getting images/video to swap.  

Likes

Translate

Translate

Report

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