Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

After Effects Split and Combine Comp Script - Help

New Here ,
Feb 18, 2012 Feb 18, 2012

Hi All

I have tried to search but to no avail so I turn to this cool forum to post my question.

We have a charity fun run coming up, and I am part of the team that films the finish line.

We record the finish line, we string the footage together into a comp in AE and we have this cool script that splits the comp up into 30 second rendered chunks. Also it staggers the split, so split 1 = 0 to 30 sec, split 2 = 15 to 45 sec, split 3 = 30 to 60 sec and so on. The goal of this is to create short video clips of 30 seconds were runners can see themselves cross the finish line. We stagger the script so the people who cross the line at say 29 sec can see themselves in the middle of the second clip, rather than the end of the first. Hopefully this all makes sense.

We would like to create a separate video of a logo spinning in, as well as a quick thank you message. We can then append these to the start and the end of each 30 second video.

So to my question...is there a way to create an AE script (or append the existing script) so that as AE splits up the video into 30 second chunks, it appends, say, the same separate 10 second comp (logo) at the start of each, and the same a 10 second comp (thank you for raising money) at the end of each of the 30 second clips?

Hopefully the above makes sense. I am pretty familiar with AE, but not so much the scripting side.

Any insight, suggestions, would be VERY welcome. Also FYI, we have over 1.5 hours of finish line footage, so LOTS of 30 second clips... hence why the splitting script was created in the first place.

Thanks

Lawrence

TOPICS
Scripting
2.7K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Feb 18, 2012 Feb 18, 2012

That should be completely scriptable. If your logo clip is it's own dedicated comp and the "thank you" is also it's own dedicated comp, then in theory you could have your main script split the clip, toss it into it's own new comp with heads and tails for the logo and thank you comps, add the logo comp at the head, then add the thank you comp at the tail. Should be doable. The question is though, how was your main script written? It's formatting quite possibly will need to be re-written somewhat to accomodate the two new comps/workflow. It all really depends.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 19, 2012 Feb 19, 2012

Thanks for the reply. Are you interested in having a look at the existing script, trying to make sense of it and having a go at adjusting it to do what you mention. I am not sure how well the existing script is written... I just know it works for the original goal... I am not really a coder and am especially new to AE script/code.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Feb 19, 2012 Feb 19, 2012

I would say feel free to post it here or email it to me, and I can try to take a look, but I can't make any guarentees on actually being able to do any full work on the script with my schedule being as packed as it is. if you do post it here, then you'll have the collective mind looking at it and a possible solution outside of my own may come to light.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 19, 2012 Feb 19, 2012

Here is the script if you or anyone else could shed some light:

----------------------------------------------------------------

// Dices 15-sec interleaved 30 second clips from 1.5 hours of footage

// Open your project in After Effects 6

// Just head to File >> Run Script and type in your comp name

var sectionName = "Rodeo2005";

var keyName = "Render comps with this string";

var searchString = "";

if (app.settings.haveSetting(sectionName, keyName)) {    

          searchString = app.settings.getSetting(sectionName, keyName);

searchString = prompt("What comps to slice and dice?", searchString);

if (searchString) {      

          app.settings.saveSetting(sectionName, keyName, searchString);   

          searchString = searchString.toLowerCase();   

          for (i = 1; i <= app.project.numItems; ++i) {        

                    var curItem = app.project.item(i);       

                    if (curItem instanceof CompItem) {            

                    if (curItem.name.toLowerCase().indexOf(searchString) != -1){   

                    var minute = -1;

                    var quadLoop = 1;

                     for (i = 0; i <= 312; ++i) {            

                              app.project.renderQueue.items.add(curItem);

                              app.project.renderQueue.item(i+1).timeSpanStart = i*15;

                              app.project.renderQueue.item(i+1).timeSpanDuration = 30;

                              switch (quadLoop)

                                        {

                              case 1:

                                        timeString = "00";  quadLoop = 2; minute = minute +1;

                                        break;

                              case 2:

                                        timeString = "15";  quadLoop = 3;

                                        break;

                              case 3:

                                        timeString = "30";  quadLoop = 4;

                                        break;

                              case 4:

                                        timeString = "45";  quadLoop = 1;

                                        break;

                                        }

                              timeString = minute + timeString;

                              if (timeString.length < 4) { timeString = padTime(timeString); }

                                        filenameString = "rodeorun"+timeString+".wmv";

                                        app.project.renderQueue.item(i+1).outputModules[1].file = File(filenameString);

                              }

                              }     

                    }  

          }

app.project.renderQueue.showWindow(true);

}

//

function padTime (time) {   

          dif = 5 - time.length;

          while (dif > 1){

                    str = ("0" + time);

                    dif = dif - 1;

                    time  = str;

          }

                    writeLn(str);

                    delete dif;

                    delete len;

                    return str;

}

//

---------------------------------------------------------------------------

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advocate ,
Feb 20, 2012 Feb 20, 2012

Ok, so they wrote the code to create unique renders via setting individual renderQueue items, and not by actually creating individual compositions for those items. Definitely the right way to go for efficiency on creating a large amount of renders, but not the best way if you want to actually add head and tail graphics to those renders. This code would pretty much need to be re-written from scratch to add the functionality for adding the head and tail graphics.

I also see in one of the comments a mention of AE 6, is that the version of AE you are currently running for this?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 20, 2012 Feb 20, 2012
LATEST

The code was written a while back but we are currently running it in After Effects CS5

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