This is a Maxscript for creating a pseudo Zdepth pass. I don’t generally use embedded zdepths in RLA or RPF frames as they can be very slow. Many jobs at Nexus make use of images on planes so swapping materials by hand isn’t an option. Check out Jim Lefevre’s Ambipur project for a great example.
This script allows you to keep all those masks and alpha channels but still render out a quick zdepth pass for compositing. It can also be quickly modified to make mattes and custom passes
To install the script download the zipped file and copy the UI and Script folders into your 3D Studio max application folder. Next time you restart Max you should find a new catagory in your Customise UI menu called BCtools, you’ll be able to assign the ZdepthSwapper to a menu or hotkey from here.
To use the script first save your scene (undo probably won’t work) as Filename_zdepth_pass or whatever, select the objects in the scene and run the script. You should find all your materials altered, go into any material and find the ‘zdepth_map’ map. From here you can change the near and far settings as you wish as they’re all connected and instanced. I usually just measure my scene to find these values.
As we’re Brazil users at Nexus it’s geared towards the standard Max and Brazil shaders (apart from Brazil basic and chrome) but you could easily convert it for other types.
I’ve been messing about writing Maxscripts for a year or so. None of them especially clever or well written but I thought this one might be of use to others.
I’m a highly experienced freelance CG & VFX Artist. In the Commercials world I’ve led many award winning projects; both as an onset VFX Supervisor and as a CG Supervisor. I’m now branching out into Film VFX and am currently at Double Negative as a 3D Generalist. read more