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

After Effects 24.2.1 exportAsMotionGraphicsTemplate() not returning correct value

Community Beginner ,
Feb 23, 2024 Feb 23, 2024

in After Effects 24.2.1, and also the previous Version (24.1.x) exportAsMotionGraphicsTemplate() is not returning the correct value, when build into an alert or if-statement.

 

in 22.x and currently 23.6.2 exportAsMotionGraphicsTemplate() returnes 'true' upon successfully finishing the export progress. in 24.2.1. the same script returns 'false'

 

also i think in the future it should be possible to disable 'include video previews' via scripting.

 

Thank you very much!

Bug Investigating
TOPICS
Import and export , Scripting , Troubleshooting , Workflow
773
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

correct answers 1 Pinned Reply

Adobe Employee , May 02, 2024 May 02, 2024

Hi @David31845386uz6e,

Thank you for reporting this issue. We are able to reproduce it on our side and have opened a ticket to investigate potential fixes. We will update this thread with any new information.

 

Thanks again,

- John, After Effects Engineering Team 

Status Investigating
Translate
9 Comments
Adobe Employee ,
May 02, 2024 May 02, 2024

Hi @David31845386uz6e,

Thank you for reporting this issue. We are able to reproduce it on our side and have opened a ticket to investigate potential fixes. We will update this thread with any new information.

 

Thanks again,

- John, After Effects Engineering Team 

Status Investigating
Translate
Report
Community Beginner ,
May 17, 2024 May 17, 2024

Hi John,

 

Thank you very much for investigating this issue.

This will be of great help for maintaining the compatability of future scripts.

 

Best,

David

Translate
Report
Contributor ,
Jan 15, 2025 Jan 15, 2025

Hi @JohnColombo if there is any progress on this?
There is already a release of After Effects 2025, but MOGRT is still not exported using the api

Translate
Report
Advocate ,
Feb 03, 2025 Feb 03, 2025

The CompItem.exportAsMotionGraphicsTemplate() function is returning a value (always false, regardless of apparent success) before the MOGRT has finished exporting. This appears to be causing subsequent export calls to fail, making reliable batch MOGRT export difficult if not impossible.

 

I am seeing this behavior in AE 24.3 on Windows 10 and in AE 25.1 on MacOS 15..2.

 

Upon calling CompItem.exportAsMotionGraphicsTemplate(), after the project is collected and the "Creating Motion Graphics Template" progress bar completes there is a significant delay before the final export operation (marked by the "Exporting Motion Graphics Template" progress bar) is carried out.

 

The script I'm using to test this with is:

 

function simpleMogrtExportTest(compToExport)
{

	var exportFolder = Folder.selectDialog("Choose a folder to which to export the MOGRT", Folder.myDocuments);
	var success = compToExport.exportAsMotionGraphicsTemplate(true, exportFolder.fsName);
	alert("Success == " +success);
}

simpleMogrtExportTest(app.project.selection[0])

 

Translate
Report
Adobe Employee ,
Feb 03, 2025 Feb 03, 2025

Hi @A. Cobb,

I reported this to the team. It appears that this issue is still being worked on. I did report it and hope we hear back from them shortly. Sorry for the problem.

 

Thanks,
Kevin

 

Kevin Monahan - Sr. Community & Engagement Strategist – Pro Video and Audio
Translate
Report
Advocate ,
Feb 04, 2025 Feb 04, 2025

Short of a fix for this, would it possible to get some ideas for workarounds? Right now the best I can come up with is a while loop checking that the MOGRT file was actually written before making the next export call.

Translate
Report
Community Beginner ,
Feb 06, 2025 Feb 06, 2025

You can check, if a try{}catch(err){} struckture inside of a helper function works for you as well.

However: our system runs on AE 23.5x52 right now.

 

function exportMogrt(comp, replace, filePath) {
    comp.motionGraphicsTemplateName = comp.name;
    comp.openInEssentialGraphics();
    saveProject();
    try {
      comp.exportAsMotionGraphicsTemplate(replace, filePath);
    } catch (err) {
      //alert("Optional Error Message");
    }
  };

 

Translate
Report
Community Beginner ,
Feb 06, 2025 Feb 06, 2025

also saveProject(); is a custom function. try app.project.save(); instead.

Translate
Report
Advocate ,
Feb 06, 2025 Feb 06, 2025
LATEST

This would only work if the Javacsript engine throws an error though, right? It isn't throwing an error, the export call is just returning an incorrect value before the operation is complete.

Translate
Report