VrayCryptoMatte, doesn't work with Xref Materials.

In short I like to add trees to my scenes with Xref Objects. But VrayCryptomatte doesn’t detect XrefMaterials, so every time I have to drag the Material out of the Xref material and onto the object for it to work. Is this something that can be improved or fixed if broken?

Also another thing that hopefully can be resolved is when working with ‘Node Material Name’, it happens a lot that submaterials of a Multi / Subobject Material have the same name (like leaves, trunk, etc). I’m not sure if there’s a way for Vray to properly detect that this isn’t the same material as trunks or leafs from another type of tree but with the same name in it’s multi / subobject mat. The result is that everything with the same name is being masked, and that’s not very helpful. Don’t know if Max has unique identifiers for materials, but maybe that’s a better idea to filter on.

Hi, thanks for posting. VRayCryptomatte works with xref objects/materials. Here is what I did to test it. Am I missing out something (the yellow box is xref object)?

Hi Vladimir, thanks for the reply. I meant Cryptomatte in Node material name mode. The Object mode works, but Xref Materials aren’t detected by cryptomatte.

I meant Cryptomatte in Node material name mode

This is what I have set up in the upper example. Maybe we are doing something different? I created a scene with a box and the yellow VRayMtl and saved it. After that in a new scene loaded the box as xref object.
Am I doing something differently/wrong?

As for the other request about multisub materials with same names, we are discussing it and I will let you know about that later.

I see, when you look at the cryptomatte render element you can indeed see the different materials (colors) BUT try to create a mask with this cryptomatte and try to pick the material in the VFB, it won’t detect anything.

Also I notice that when I have 2 cryptomattes (one for Node name and one for Node material name). I’m able to switch between them in the mask, which is normal of course.

When I pick the Node name cryptomatte and I select an object, the object is added to the list, but I can then switch to the Node material name, the object is still in the list, but doesn’t have any effect anymore. Wouldn’t it be more logic, that the object is discarded (although better with a warning that you might loose the already added items) that was previously in the Node name cryptomatte.

Hi, I still can not figure out what is your issue with xref object. Here is a recording from my test scene, the yellow box is xref object with xref material.

3dsmax_2023-06-22_17-49-32.gif

As for the list of objects you are right. It is shared between the two VRayCryptomatte render elements, so when adding object to both render elements they are stacked in the same place. They both work though and each one knows it’s objects. We will consider adding separate lists to each VRayCryptomatte render element if this is technically possible.

Ok, now I see, MultiSub Object materials in Xref materials, don’t work with CryptoMatte

XrefMatCrpyto.gif​

We are always working on large scenes with many xrefs in our studio and never had problems with MultiSub Object materials in Xref materials. Granted that we use EXR.io to get the selections inside PS for post work. I replicated your scene and it seems to work ok in the frame buffer also. We are on Max 2022 and Vray 6.10.04.

That is extremely weird, what am I doing wrong? I’ve attached my scene to this post. I just tried to recreate in a fresh scene and it still gives me these results.

Can you test if it works with any of you? I’m on Max 2023 with Vray 6.10.08 though. Thank you, this is very annoying.
Xref_Problem.zip (151 KB)

Can you please save the file in max 2022?

Here ya go. Thanks for testing. Not sure if it isn’t version related ofcourse.
Xref_Problem_22.zip (173 KB)

Well it seems to me it is version related. I’m not sure if vray or max. Maybe the devs can help us out with that information.
I’ve tested your file and it is working ok.

Very weird, thanks for testing, right now I have about 50 plants and trees loaded as xrefs, so I have to manually go through all of them and assign them their none-xref material. Hope Chaos can confirm soon and come with a fix.

Hi @garipodelu you are using x-ref scene that is why it works in your case. We are testing x-ref object setup and it does not work in none of the versions I tested. I will talk to the developers about the VRayCryptomatte for x-ref object.

Ah yeah that’s what I thought at first but didn’t see in the screenshot you used XrefScene.

@vladimir_krastev thank you, would be awesome and save us a lot of time.

Thanks for clarifying that. Indeed we always use x-ref scene in our workflow.
@Vizioen maybe you can switch from xref objects to xref scenes as a workaround and if you need to move objects just attach them to a dummy object.

Well that would impair my workflow to mock-up scenes fast. I have a lot of landscaping to do, sometimes with very specific trees, and a lot of different kinds. I have most of these in my library (Connecter). I just drag them in my Max import as Xref object and I’m good to go, if I need to change something about the tree I’m still flexible with an Xref Object. Not so much with XrefScenes and VrayProxies. Once I’m done I can still convert to proxies, but most of the time that doesn’t happen as there’s no need.

The issue is reported under VMAX-13406 in our bug tracking system.

Hi, @vladimir_krastev , any update on this? Thank you.