Skip to main content
Inspiring
May 22, 2026

AEGP_GetNumProjects still return 1 if I close the project

  • May 22, 2026
  • 2 replies
  • 45 views

I was trying to figure out if any project was loaded using the call AEGP_GetNumProjects in the IdleHook. However, once a project is loaded, this function only returns 1, even if I close the project. The only situation where I got it to return 0 was when I tried to load an old project that failed to load.

 

Pretty simple to replicate, just call AEGP_GetNumProjects from the IdleHook and check the returned value after closing the project from “File/Close Project”.

 

I’m using the windows version of AE 2026 v26.2.1 (build 2). But I suppose this is common to other versions too.

    2 replies

    Adobe Employee
    May 30, 2026

    Hi octaviosa,

    Even when there is no project that has been opened from a file on disk After Effects basically has a valid empty project ready that has yet to be saved to disk that will cause AEGP_GetNumProjects to return 1. You should be able to see this by simply launching After Effects and calling AEGP_GetNumProjects without ever opening a project. It should be rare to ever see 0 here. I just opened an invalid XML project that properly did not get imported but After Effects still returned 1 after displaying the error because the existing empty project is still valid and ready to take other AEGP calls. It’s possible the older project you used that failed to load has possibly left After Effects in a bad state. If you want to directly send me a stripped down project that causes a 0 return value I can take a look.

    Thanks,

    Jamie 

    octaviosaAuthor
    Inspiring
    June 12, 2026

    Oh, ok I get it, it kind of makes sense. However, won’t this make this function kind of useless? Maybe it was intended for something in the future.

    Adobe Employee
    June 12, 2026

    it’s a way to test if there is a valid project in AE at the time of doing other operations - that is pretty much it. and for now it will never return anything else than 0 or 1.

     

    thanks,

    Jamie

    Nishu Kushwaha
    Community Manager
    Community Manager
    May 28, 2026

    Hi octaviosa, thanks for writing in. Since this is an AEGP API behavior question, I'll route it to the AE SDK engineering team for an authoritative answer.

    Will follow up here once I have feedback from the team.


    Thanks,

    Nishu