Yes, submesh materials are managed by Spine's code (any manual changes will be overwritten) because each submesh could be comprised of any collection of attachments, which may use a specific Materials.
What material it uses is stored in the Attachment objects themselves.
If these mask images will ALWAYS use a different shader, you can just change the Material reference stored in each of the relevant Attachments. You can do this at load time after the skeleton data has loaded.
You must find all the references to the relevant attachments.
You can get their references either on their slots, or in the skeleton's default/active skin.
Then you can use this method:
static void SetMaterial (List<Attachment> attachments, Material replacementMaterial) {
var page = new AtlasPage {
name = replacementMaterial.name,
rendererObject = replacementMaterial
};
foreach (var a in attachments) {
var ra = a as RegionAttachment;
if (ra != null) {
((AtlasRegion)ra.RendererObject).page = page;
continue;
}
var ma = a as MeshAttachment;
if (ma != null) {
((AtlasRegion)ma.RendererObject).page = page;
continue;
}
}
}