
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.
Click to download the script installer.
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 download your scrip and the computer. But I doing not understand the zip. What is the zip?
BTW. I make the first commenting. Does I have reward??
Eddy.
Hi Ben,
Thanks for posting the script.
We tried out the script on a small sample scene and it worked great, but when it came to using it on the larger scene that we really need it in, it crashed. Do you know of any reasons that might happen? Things we should watch for?
We are using the Max scanline renderer. We have planes with opacity maps (leaves) and other general geometry. Your script could be very useful for us in a bind so we are looking for any reasons ourselves it might crash and will get back to you. If you could do the same it would be great.
Thanks
Dann
Hi there Dann,
Does the script crash or the render ?. If it’s the script can you tell me the error message you get down in the listener window (bottom left).
cheers
ben
ha ha ha!!
I was trying to find out how to get this and our head of 3D, Ben Cowell, is away on honeymoon so I googled it and found your site.
Oh the irony.
Trackback this post | Subscribe to the comments via RSS Feed