# \[Solved\] Cannot mask a material with an Xref with CMask

**URL:** <https://forums.chaos.com/t/solved-cannot-mask-a-material-with-an-xref-with-cmask/155620>\
**Category:** Help Required\
**Created:** [March 23, 2023, 5:55pm UTC](https://forums.chaos.com/t/solved-cannot-mask-a-material-with-an-xref-with-cmask/155620 "2023-03-23T17:55:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![FrankGehry](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/frankgehry/32/72662_2.png) [@FrankGehry](https://forums.chaos.com/u/FrankGehry)\
**Post date:** [March 23, 2023, 5:55pm UTC](https://forums.chaos.com/t/solved-cannot-mask-a-material-with-an-xref-with-cmask/155620/1 "2023-03-23T17:55:47Z")

</div>

I’m trying to create a monchrome mask of a material within an Xref that is then plugged into a subobject material. I have the G-buffer ID set to 9 in the material, and the CMask setting, but I’m still not getting a mask. Is there anything else I could be doing wrong?

---

<div class="post-metadata">

**Author:** ![FrankGehry](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/frankgehry/32/72662_2.png) [@FrankGehry](https://forums.chaos.com/u/FrankGehry)\
**Post date:** [March 23, 2023, 6:57pm UTC](https://forums.chaos.com/t/solved-cannot-mask-a-material-with-an-xref-with-cmask/155620/2 "2023-03-23T18:57:33Z")

</div>

I got it to work, but I had to open up the Xref itself and change the Gbuffer ID there instead of doing it in the slate editor within the main file.

---

<div class="post-metadata">

**Author:** ![AramAvetisyan](https://dub1.discourse-cdn.com/chaosprd/user_avatar/forums.chaos.com/aramavetisyan/32/271059_2.png) [@AramAvetisyan](https://forums.chaos.com/u/AramAvetisyan)\
**Post date:** [March 24, 2023, 8:43am UTC](https://forums.chaos.com/t/solved-cannot-mask-a-material-with-an-xref-with-cmask/155620/3 "2023-03-24T08:43:58Z")

</div>

Hi,

Yes, this is the current expected way to do the masking if you have an XRef file.  
XRefs should be controlled within the original files, not from the file they are embedded/linked in.
