// ISO_RenderQueueSplitIntoSeparateProjects.jsx // Artist: https://www.jasonfletcher.info/ // Code generated by ChatGPT-5.5 // Date: June 7, 2026 // Description: This After Effects script takes the selected comps in the Project panel, splits them into fixed-size batches (user defined), adds each batch to the Render Queue, and saves a separate After Effects project file for each batch. // WHY IS THIS USEFUL? // Reason #1: If you’re rendering somewhere over 600+ comps, then you’ll run into a known bug with After Effects 2026 (and prior versions) where if you try to add too many comps into the render queue then the GUI will overflow and glitch out. This is because the current UI framework only supports a panel being 30,000 pixels wide or long. I've reported this bug to Adobe and the dev team is working on a fix. - https://community.adobe.com/bug-reports-528/too-many-comps-will-glitch-gui-1554202 // Reason #2: If you're rendering multiple instances via Aerender, or rendering back-to-back projects via Aerender, then this script can save you some manual work in setting up the render queues. Here is an article with more info - https://github.com/nuclearsugar/AfterEffectsScripts/blob/main/Doc%20-%20Rendering%20Multiple%20Instances%20via%20Aerender.md // Reason #3: If you're rendering for more than 24 hours, the AE render engine will gradually slow down over long uninterrupted renders. After 48 hours of continuous rendering, I frequently see the per-frame render times slow down by a factor of two and yet I know that the complexity of the comps is consistent. So by reloading the whole AE render engine every so often, it will maintain consistent performance and avoid slow downs. (function () { app.beginUndoGroup("Create Render Queue Batches"); // Ask user for batch size var batchSizeInput = prompt( "Enter batch size:", "10" ); if (batchSizeInput === null) { app.endUndoGroup(); return; } var BATCH_SIZE = parseInt(batchSizeInput, 10); if (isNaN(BATCH_SIZE) || BATCH_SIZE < 1) { alert("Please enter a valid batch size greater than 0."); app.endUndoGroup(); return; } // Gather selected comps var comps = []; var sel = app.project.selection; for (var i = 0; i < sel.length; i++) { if (sel[i] instanceof CompItem) { comps.push(sel[i]); } } if (comps.length === 0) { alert("No comps selected."); app.endUndoGroup(); return; } var outputFolder = Folder.selectDialog( "Select folder for batch AEP files" ); if (!outputFolder) { app.endUndoGroup(); return; } var originalFile = app.project.file; var baseName = originalFile ? originalFile.displayName.replace(/\.aep$/i, "") : "BatchProject"; var batchNum = 1; for (var start = 0; start < comps.length; start += BATCH_SIZE) { // Clear previous batch from render queue while (app.project.renderQueue.numItems > 0) { app.project.renderQueue.item(1).remove(); } // Add current batch for ( var j = start; j < Math.min(start + BATCH_SIZE, comps.length); j++ ) { app.project.renderQueue.items.add(comps[j]); } var batchName = baseName + "_Batch_" + ("000" + batchNum).slice(-3) + ".aep"; var saveFile = new File( outputFolder.fsName + "/" + batchName ); app.project.save(saveFile); // If another batch remains, clear the queue now. // If this is the final batch, leave it intact. var nextStart = start + BATCH_SIZE; if (nextStart < comps.length) { while (app.project.renderQueue.numItems > 0) { app.project.renderQueue.item(1).remove(); } } batchNum++; } alert( (batchNum - 1) + " .AEP project files exported\n\n" + BATCH_SIZE + " comps per render queue" ); app.endUndoGroup(); })();