Cryptomatte is a tool created in Psyop by Jonah Friedman and Andy Jones. Automatically create matte IDs with support for motion blur, transparency and depth of field, using information already available at the time of rendering. This information is typically names, object namespaces, and material names.
The script is available at this link: https://github.com/Psyop/Cryptomatte
Available for Nuke and Fusion
Version history here: https://github.com/Psyop/Cryptomatte/blob/master/CHANGELOG.md