MultiMatteElement Render pass of XRef Scenes not shown in XRef "Mother" Scene

I work a lot with XRef Scenes. To have more flexibility in post production I assign Efffect IDs to my materials in the XRef-ed scenes. I use a script of KStudio called “Material/Object ID manage” which creates the neccesary render passes in the render setup. When I insert these scenes into the “Mother” scene these Effect IDs are not shown in the dialog of that script and will not be rendered of course. But when I assign these materials with their Effect IDs from the XRef scene also to objects in the XRef mother scene I can render the MultiMatteElements from the XRef scnes. So I have to insert all materials into the mother scene first to see the MultiMatteElements also from the XRef scenes. Is there a way to do it quicker? I hope someone can understand what I wanted to say.

Hi, thanks for posting. Merge the matte render elements from your x-ref scene in your main scene, this should work. Also VRayCryptomatte answers all questions related to masks. No need of a script or setting anything, just use cryptomatte. You may need a multimatte only for the stuff behind glass.

Thank you very much, I will try it. I wanted to prevent merging things from my XRef scenes into the “mother” scene. But if VRay Cryptomatte solves it all is fine!
Update: VRay Cryptomatte --> Awesome!