3

I'm working on a giant project file that was obviously created by importing lots of other projects into one big one.

Many of the comps use many of the same precomps ... from projects that were copies of each other ... so there are many precomps that are probably identical, but each is used in a different master comp.

Is there any way to (a) check if 2 comps are truly identical?

And (b) automatically replace all references to identical comps with references to just one copy, so that the project can then be properly reduced?

1 Answer 1

2

I do not know of and couldn't find a script that does this already but it would be certainly possible to write one. After Effects doesn't have a functionality built-in for that.

With the help of ExtendScript you can write very powerful extensions for After Effects and its very easy to get going with it. Just open up the "Adobe ExtenScript Toolkit" that gets installed with every CS suite and load up an example for After Effects and have a look at the JavaScript documentation. While you can also script with AppleScript and Batch Script the documentation for the JavaScript version is a lot better. You can access it under the "Help" menu. Most importantly look at the After Effects Scripting guide. It can be found for different CS/CC versions here.

What I would do is start to iterate through all your compositions, grab the current composition in your iteration, get an array of all the layer names in that composition and then iterate with that array through all compositions and compare the array with the array of all the other compositions. Best to not sort the arrays in case you used generic names for layers and unique layer ordering is important.

Unless you have micro changes in your duplicate comps like changed property values and keyframes this approach would be effective. If you do have micro changes you would, after having fetched all comps with duplicate layers, also have to access every layer in your array and compare every property with the corresponding layer in the other comp.

You then delete all true duplicates of a comp and while doing that replace them with a link of your now unique comp in all occurrences in other comps.

Shouldn't be much code but it could take some time to write if you have never used Adobe ExtendScript.

On another note, a very helpful plugin to keep the composition import madness at a minimum is BAO Dynamic Comp.

2
  • That kind of coding is beyond me ... but would be great if someone else wrote it! I wonder if there's a "suggestion box" at aescripts.com...
    – Dan
    Aug 19, 2014 at 16:38
  • This sounds like a good challenge.
    – stib
    Aug 20, 2014 at 13:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.