Hello! First of all, let me say that I find it absolutely great that now cryptomatte is available in eevee! thanks a lot, @JeroenBakker! I think this is a good moment to try to make sense of how are cryptomatte stored and how it is supposed to be used in third party programs, e.g. Nuke, and maybe fixing the unconsistencies I found.
Note: all I talked about from now on is referring to rendering multilayer .exr, as we use in our productions
The output wasn’t consistent before in how the cryptomatte data is stored, depending on the method you used, the properties panel output or the compositor’s file output node. the thing is, now I find the same discrepancies between cycles and eevee, even when only using the properties panel.
How it works rendering via cycles-properties panel:
When opening the saved exr in nuke, the metadata information gives you this list of keys (with its associated values/hashes):
As you can see, the cryptomatte keys are stored individually (and separated from the rest of the channels), and so you can use them as cryptomatte layer selections (although even in this case is quite annoying to use since you have to always modify the metadata to change the . for a _ in the layer name). But in the end it works, so no unworkable problem.
How it works rendering via the compositor (file output node):
But then, when you use the file output node from the compositor, it gives you this metadata instead:
Here you can see that there is no cryptomatte key/value data. Instead, they are stored within the channel key, which seems to be a single list:
main.Combined.A:{1 0 1 1},main.Combined.B:{1 0 1 1},main.Combined.G:{1 0 1 1},main.Combined.R:{1 0 1 1},main.CryptoAsset00.A:{1 0 1 1},main.CryptoAsset00.B:{1 0 1 1},main.CryptoAsset00.G:{1 0 1 1},main.CryptoAsset00.R:{1 0 1 1},main.CryptoAsset01.A:{1 0 1 1},main.CryptoAsset01.B:{1 0 1 1},main.CryptoAsset01.G:{1 0 1 1},main.CryptoAsset01.R:{1 0 1 1},main.CryptoAsset02.A:{1 0 1 1},main.CryptoAsset02.B:{1 0 1 1},main.CryptoAsset02.G:{1 0 1 1},main.CryptoAsset02.R:{1 0 1 1},main.CryptoMaterial00.A:{1 0 1 1},main.CryptoMaterial00.B:{1 0 1 1},main.CryptoMaterial00.G:{1 0 1 1},main.CryptoMaterial00.R:{1 0 1 1},main.CryptoMaterial01.A:{1 0 1 1},main.CryptoMaterial01.B:{1 0 1 1},main.CryptoMaterial01.G:{1 0 1 1},main.CryptoMaterial01.R:{1 0 1 1},main.CryptoMaterial02.A:{1 0 1 1},main.CryptoMaterial02.B:{1 0 1 1},main.CryptoMaterial02.G:{1 0 1 1},main.CryptoMaterial02.R:{1 0 1 1},main.CryptoObject00.A:{1 0 1 1},main.CryptoObject00.B:{1 0 1 1},main.CryptoObject00.G:{1 0 1 1},main.CryptoObject00.R:{1 0 1 1},main.CryptoObject01.A:{1 0 1 1},main.CryptoObject01.B:{1 0 1 1},main.CryptoObject01.G:{1 0 1 1},main.CryptoObject01.R:{1 0 1 1},main.CryptoObject02.A:{1 0 1 1},main.CryptoObject02.B:{1 0 1 1},main.CryptoObject02.G:{1 0 1 1},main.CryptoObject02.R:{1 0 1 1},main.Depth.Z:{2 0 1 1}
So now there is no way to access them from the cryptomatte node (as far as I know, if I’m wrong please let me know), because they are mushed together with the rest of the passes.
How it works rendering via eevee-properties panel:
Ok, so that was the old inconsistency within Cycles. But now, the Eevee implementation seems to behave the same way the compositor does, storing all crypto data inside that single list, instead of independently in their own channels (key/value pairs):
Note that this last example looks the same as the previous one, even though one is rendered in cycles from the compositor, and the other is rendered in eevee from the properties panel. And the channel list looks the same as well, with the crypto data stored inside as list items.
Conclusion.
The file output node is a different conversation in itself, but I think these discrepancies in the way cryptomatte is stored should be addressed (in the very least, both rendering outputs from the properties panel should be stored the same way), and I believe now that a new implementation is being worked on it is a good moment to tackle it.
I don’t doubt there is some way to access that information through programming, but I think it should be available right from the start in a way that is more industry compatible.
Again, thanks for all the awesome work, you guys rock!
PS: I haven’t tested the fileOutput node version in eevee because for some reason the render doesn’t get written in disk in the latest version in 2.92