PDA

View Full Version : Applescript to help with getting big renders into AE


govinda
05-05-2008, 09:48 PM
In brief, it stinks to get big c4d image sequence renders into AE. Doing command-i on a folder with 20,000+ images will kill your eyes and take a needlessly long time. And you can't drag-and-drop a messy folder onto AE like you can with other composting apps. It'll read it as 20,000 individual images.

For Mac users, one way to make it easier would be to subfolderize your main render folder. Then you can just drag and drop the subfolders into AE, which will then recognize them as sequences rather than individual files. But c4d won't render multipass to subfolders like I believe other apps will (please go suggest this at Maxon).

So I asked someone to create an Applescript to help, and they came through. Here's a demo of it:

Subfolderize Demo Movie
(http://www.planetsandvegetables.com/image_seq_subfolderize_sor.mov)
Here's the script. Use at your own risk, and all the other disclaimers. I'm using it daily on big renders. Looking at the script (and the demo movie) you should see how to change it for your needs. Hope this helps.

Rendered Image Sequence Subfolderize 3.01
set sourceFldr to POSIX path of (choose folder with prompt " Please select a source folder.")
-- Create the subfolders in the folder.
do shell script ("mkdir -p " & quoted form of sourceFldr & "{rgb,refl,motion,normal,shadow,specular,object_{1,2,3,4,5},post_1}")

set subfolderNames to {"rgb", "refl", "motion", "normal", "shadow", "specular", "object_1", "object_2", "object_3", "object_4", "object_5", "post_1"}

repeat with thisFolderName in subfolderNames
do shell script "find " & quoted form of sourceFldr & " -type f -name \"*" & thisFolderName & "*\" -maxdepth 1 -print0 | xargs -0 -J {} mv {} " & quoted form of (sourceFldr & thisFolderName)
end repeat

danb
05-06-2008, 12:54 AM
Thanks for sharing Govinda.

Is this a Mac issue only? I was working in AE the other day and did'nt have any problems with image sequences as .tiff's.

Per-Anders
05-06-2008, 01:01 AM
You shouldn't need to drag & drop into AE, just select the first frame on the import file/multiple files and make sure that the checkbox is marked for import x sequence.

govinda
05-06-2008, 01:26 AM
Okay, I expected both those questions. :D

Dan, there's no general problem getting image sequences into AE. This is for renders of a lot of frames. The demo movie shows a render of 4,800+ frames, which is hardly a lot of frames for people who do multipass.

Per, the command-i method is fine up to a point. When you have multiple passes on several hundred frames, and you're doing it all the time, this script will save hours over the basic command-i that you're talking about. Recently I did 7 renders of 480 frames each in 8 multipass passes for a total of more than 28,000 frames. Getting that into AE was far more trouble than it should be.

Another answer would be if Cinema supported multichannel EXR output. ;)

Per-Anders
05-06-2008, 03:19 AM
What's wrong with multichannel tif/psd? They both support higher bit depths.

govinda
05-06-2008, 03:44 AM
Multilayer tiffs, no dice, not into AE.

Multilayer PSDs, close, because they do come into AE as compositions, but what about object buffers? PSD puts them in channels rather than layers. So that means you need an action that'll make layers out of your channels...for thousands of image files.

But I think your comment was more about my EXRs mention. As a matter of fact, I was being a little bit sloppy because AE may not read them properly either. But I wouldn't know because no app I use creates them, hint hint.

heathivan
05-06-2008, 04:33 AM
If I'm understanding your script correctly, I think its possible you could have done this yourself using the AUTOMATOR app that comes with OSX. It allows you to set up file renaming, moving and other conventions by sequencing a library of commands. I've had luck renaming files sequences to other folders by using it, and I'm no programmer.

Just a thought for future possibilities,

---h

govinda
05-06-2008, 04:55 AM
Yeah, someone mentioned that last week, but you may get into beach-ball land with anything over a couple thousand files.

An earlier version of this script that didn't use shell commands was many times slower and locked up my finder during processing.

Hey, I used the term 'shell commands' as if I knew what I was talking about. :D

marcorabellini
05-06-2008, 06:29 AM
Here's a version of this kind of thing I did for Windows. Save this as a batch file (.bat). Put the bat file and empty folders with names that match the names in the file into a folder with the files you want to sort and run the bat file. You can create whatever folders you need and edit the bat file as needed.

move /y "*rgba*.psd" "RGBA"
move /y "*object_1*.psd" "Object_1"
move /y "*object_2*.psd" "Object_2"
move /y "*object_3*.psd" "Object_3"
move /y "*object_4*.psd" "Object_4"
move /y "*object_5*.psd" "Object_5"
move /y "*object_6*.psd" "Object_6"
move /y "*object_7*.psd" "Object_7"
move /y "*object_8*.psd" "Object_8"
move /y "*object_9*.psd" "Object_9"

I'm not a programmer by any means, so there may be a way to customize this more to do even more automatically.
m

akport
05-06-2008, 12:19 PM
I had just recently ran into this issue and was going to post in search of a solution. It would be great if C4D had an option to render to a folder structure. This should be a huge help. I'll check it out later.

Thanks,
Adam

danb
05-06-2008, 01:57 PM
I had just recently ran into this issue and was going to post in search of a solution. It would be great if C4D had an option to render to a folder structure. This should be a huge help. I'll check it out later.

Thanks,
Adam

If you "save project" this will create all settings to a new folder.

CGTalk Moderation
05-06-2008, 01:57 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.