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

Replace Composition for multiple languages

New Here ,
Oct 24, 2011 Oct 24, 2011

Hello,

I'am totally new to scripting for AE and this is my first post here.

I have a Composition containing 7 other comps with text. And I got this text in 5 different languages. Plus there are in total 5 Comps with 7 Textcomps each wich are needed in 5 different languages. I could go by hand and replace the 5*7*5 Comps via drag drop. But I am hoping that you can help me with a less painful solution.

The names of the compositions are like EN_compname1 or IT_compname1. What I would need, is a script thats asks for the first two letters and then replace the compositions. I already googled, crawled through aescripts.com and searched this forum, but I couldn't find a hint that would help me.

Can you?

TOPICS
Scripting
1.4K
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
Community Expert ,
Oct 24, 2011 Oct 24, 2011

I doubt that there's an existing script that does exactly what you want. The good news is that it sounds pretty straight forward and not a bad scipt to tackle as a first script if you have some time.

Basically, you need to:

  1. Prompt the user for the language code.
  2. Go through all the affected comps looking for the layers that start with the existing/default language code.
  3. Do a replaceSource() on those layers, replacing their sources with the appropriate language precomp.

Dan

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 ,
Oct 29, 2011 Oct 29, 2011

WARNING, WARNING, WARNING: I suggest testing this on a DUPLICATE of your aep project file first, just in case.

If you are simply trying to swap one precomp for another and the naming structures are IDENTICAL with ONLY the first two letters changing, like this...

Old:

MAIN COMP1 > EN_compname1

MAIN COMP2 > EN_compname2

MAIN COMP3 > EN_compname3

New:

MAIN COMP1 > IT_compname1

MAIN COMP2 > IT_compname2

MAIN COMP3 > IT_compname3

Try this out. It will search every layer in your entire project for your chosen language ID ("EN", "IT", "FR", "DE" or "JP"). If you need different names let me know and I will update it for you.

CompLanguageSwap.zip

Message was edited by: David Torno (fixed broken link)

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
Explorer ,
Nov 21, 2011 Nov 21, 2011

Have you tried the True Comp Duplicator?  http://aescripts.com/true-comp-duplicator/

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 ,
Nov 26, 2011 Nov 26, 2011

Sorry for the huge delay.

We ended up, not replacing comps but instead created the texts in different languages as PNG out of the existing webGL animation and only replacing the sourcepaths in the AEPX File.

items = aepx.find("/ae:AfterEffectsProject/ae:Fold/ae:Item")

for item in items

  reference = item.find("./ae:Sfdr/ae:Item/ae:Pin/ae:Alas/ae:fileReference")[0]

  reference.attr("fullpath", myPath)

 

aepx.save()

(pseudo script)

@Dan @David

Thank you for your help. Now i know a bit more about scripting. But in this case the XML Replace Method is easier and quicker. Said my programming colleague.

@Lloyd

Yes, i tried the TCD - but would have only done part of the job. But thx anyway.

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
Explorer ,
Nov 26, 2011 Nov 26, 2011
LATEST

We also have a script that will batch process a folder full of projects and

search an replace paths:

http://aescripts.com/batch-search-n-replace-paths/

Lloyd

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