View Full Version : Need 3DsMax post render script for compositing in After Effects
02-25-2009, 04:03 PM
I do a lot of compositing in After effects and create all my 3d elements in 3d studio max. I use render elements in every render and spend a lot of time when trying to import these image sequences into after effects. Since after effects does not condense an image sequence into one file it takes a lot of time importing multiple image sequences. I have to sort through a folder with hundreds of images and select each individual image sequence for import. Just getting my image sequences into after effects can take 30 minutes. If an image sequence is separated into its own folder though After Effects will import the folder as a image sequence. A time saving solution to this would be a post render script from max. The script would query the render elements and look in the name field of each render element. It would then create a folder for each render element based on the name field. The script would then move each image sequence into its corresponding folder. This would make importing very easy since you could now just grab all the folders with their single image sequences and drag them straight into after effects. Since each image sequence is in their own folder After Effects would import each image sequence separately and correctly. Unfortunately I do not know maxscript and waste hours of my life importing image sequences. Can someone help me?
07-02-2009, 10:45 AM
Max can export directly to Combustion as a Workspace project file so it would negate all of your problems - maybe look at your compositing package. The other thing is that can't you define which folders elements are rendered into by just selecting a path.
Otherwise what are you asking when you say help me out - I'm not sure anybody will spend time writing what seems to be a complex scripting issue to save you time.
07-02-2009, 11:25 AM
for i = 1 to NumRenderElements do
re.SetRenderElementFileName ("c:\\insert\\your\\directoryhere\\"+ i as string"\\ + ".whateversuffixyouneed")
Doesn't move anything, but creates (or should) paths for each element before rendering. Not tested.
Moving files doesn't need any script actually. Any file wrangler (Total Commmander or similiar) can do this. You still will have to select and move files by hand, buts it's a matter of minutes, if at all.
07-02-2009, 11:27 AM
Why not just edit the paths of the elements to the appropriate folders before rendering? Just a thought.
07-02-2009, 11:54 AM
i cant work out why you would put all the passes into the same folder. why not do it like artur suggested? Just change the location for each pass.
At the very least, make sure the pass has a suffix like "_specular" and use the 'Sequence' checkbox in the import file dialog - that will bring in all frames for each pass. :shrug:
07-06-2009, 11:08 PM
That's how we organize our RE's here... Here's the function to do so..
fn RePathRenderElements =
if ( rendOutputFilename != "" ) then
local REmgr = maxOps.GetCurRenderElementMgr()
for i = 0 to (REmgr.NumRenderElements()-1) do
local RE = REmgr.GetRenderElement i
local NewName = (( getfilenamepath rendOutputFilename ) + RE.elementName +"\\"+ ( filenamefromPath rendOutputFilename ) )
makedir ( getFilenamePath NewName )
REmgr.SetRenderElementFileName i NewName
callbacks.removeScripts #preRender id:#RepathRenderElements
callbacks.addScript #preRender "RePathRenderElements()" id:#RepathRenderElements
I just put it in a .ms file, just unzip this .ms and put it in your startup folder.. It'll folder your render Elements every time you render...
07-06-2009, 11:08 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.
vBulletin v3.0.5, Copyright ©2000-2013, Jelsoft Enterprises Ltd.