Cryptomatte custom AOV

Cryptomatte custom AOV

edenexposito
Enthusiast Enthusiast
1,981 Views
10 Replies
Message 1 of 11

Cryptomatte custom AOV

edenexposito
Enthusiast
Enthusiast

Hi,

Seems that Cryptomatte support custom AOV's (not only crypto_asset, crypto_object, crypto_material). I'm trying to create a custom AOV to store vertex color information, (I'm called crypto_vertex) but I don't know how to do it properly.

I had create a custom aov (crypto_vertex) and I create this chain:

1245-cryptomatte-custom.png

Somebody has created this kind of custom AOV, not only for vertex_color... any other beyond crypto standard AOV (asset, object, material).

Seems that input expect some kind of string variable (give me an error if I try to add RGB nodes)

Thanks to all

0 Likes
1,982 Views
10 Replies
Replies (10)
Message 2 of 11

peter.horvath6V6K3
Advisor
Advisor

I don't think it works that way. The shader expects the name of a string type user parameter in User crypto src 0, and creates the ID hash from the string in the user parameter. So basically instead of using the object or material name you can define a custom string to use as the ID.

0 Likes
Message 3 of 11

edenexposito
Enthusiast
Enthusiast

A simple usage example will be great!

0 Likes
Message 4 of 11

peter.horvath6V6K3
Advisor
Advisor

Attached is a basic scene to demonstrate the usage of the user aovs. There's a user parameter on the objects, called 'myname'. That's the source of the user aov. You can define any custom name for the objects in the 'myname' parameter, they are used as the IDs in the custom user aov.

cryptomatte-custom-name-test.zip

So it's probably not what you were after.

0 Likes
Message 5 of 11

cdordelly09
Enthusiast
Enthusiast

Hi guys! I made a script to automate this process with a simple UI:

1300-capture.png

I made it from the Cryptomatte script from SA support site, you only need to select which object you want to add the user data and if you want to give them different IDs like others Cryptomattes or the same ID.

It have only one bug, I don't how can avoid the user data repetitions if you select one input that already have the object, do you know how to do this? Or how can I assign a Crypto User Data Tab only for this user datas.

Hope you find it useful, cheers!

crypto-custom-data-v05.zip

0 Likes
Message 6 of 11

peter.horvath6V6K3
Advisor
Advisor

Here's an updated script which does not create a new user data when one with the same name already exists.

1302-crypto-custom-data-v06.zip

As far as I know you can not create your own Crypto User Data tab.

0 Likes
Message 7 of 11

cdordelly09
Enthusiast
Enthusiast

Awesome! you're the best @Peter Horvath, thanks for this.

0 Likes
Message 8 of 11

edenexposito
Enthusiast
Enthusiast

It's only possible use object ID info?

I think that would be more interesting if we can create a custom cryptomatte pass but with "faces selections", "vertex color" and other info beyond object ID. Maybe it's possible and I simply don't know how to name or add this "variables".

I have tried to generate a custom user data in Vertex Color tags instead in objects but seems that not work.

It's possible? An example of how to add this kind of data would be great!

0 Likes
Message 9 of 11

peter.horvath6V6K3
Advisor
Advisor

You can write out custom AOVs via the aov_write shaders, like in this tutorial, but that's independent from cryptomatte: https://support.solidangle.com/display/A5AFCUG/AOV+Object+ID

0 Likes
Message 10 of 11

edenexposito
Enthusiast
Enthusiast

Thanks @Peter Horvath I know that, but again same object ID example.

I suposse that with custom AOV we can go beyond object ID's. I thought that is difficult know what other variables exists and is hard to find a little examples to know how theses other variables can be used with custom AOV.

An aditional Arnold help page with this kind of info would be wellcome.

0 Likes
Message 11 of 11

edenexposito
Enthusiast
Enthusiast

Maybe now somebody can add how to do it this like RedShift team as do it here https://docs.redshift3d.com/display/RSDOCS/Cryptomatte?product=cinema4d

0 Likes