About Custom Model Processors

Hi !

I’m working on my custom content model processor, and I was wondering why on some models I get an “ArgumentOutOfRange” exception while they were building ok with the default model processor.
I’m assigning textures, along with an effect at build time. It works ok but not on all models as this process certainly requires some missing data from the model in some cases (textures UV, etc)

After some investigation and my extension’s debugging, I’ve found this in Monogame’s code (the only location I’ve found this string) in MaterialProcessor.cs, Line 237

throw new ArgumentOutOfRangeException("Unknown material content type!");

So I searched the references to this method, and only one was returned by VisualStudio;

for (var i = 0; i < textureChannels; i++)
    if (!geometry.Vertices.Channels.Contains(VertexChannelNames.TextureCoordinate(i)))
        throw new InvalidContentException(
            string.Format("The mesh \"{0}\", using {1}, contains geometry that is missing texture coordinates for channel {2}.", 

So in conclusion, at some point, the convertion fails and falls back to a default effect on this model (found here:
Is it true to say this is triggered because the model does not have any UVs defined and the pipeline does not return the “true” error message ?
Or am I missing something and I really messed my modelprocessor up ?